1

I want to be able to make a card and add it to a list of cards. The card has two variables, cardName and cardNum. I want to be able to assign both variables values in the same line using inputs from the user.

Code I used:

def Card():
  cardName, cardNum = input('Card name : '), input(' : Card number : ')
  card = f'{cardName} : {cardNum}/{cardsInSet} '
  library.append(card)

What I want:

Card name : Spark Jump : Card number : 123

What I get when running my code:

Card name : 123
 : Card number : 123
khelwood
  • 55,782
  • 14
  • 81
  • 108
  • I could do that if the values are predetermined, but I'm looking to be able to take both inputs from the user on the same line without creating a new line from input(). – Jacob Hanney Nov 04 '21 at 14:41
  • It's not "a new line from input()", it's a new line when you hit enter to submit the first input. – h4z3 Nov 04 '21 at 14:42
  • How would I avoid hitting enter twice and also give two inputs, also I thought input() created a new line. – Jacob Hanney Nov 04 '21 at 14:44

0 Answers0