0

I'm new to python and I made this code to get a number from the user. Im not sure how but i want to make input boxes equal equal to the number placed in the first line of code.

code

x = input("How many video games do you own: ")
list1 =[x]

for games in list1:
    name1=input("Enter game1: ")

What i want to happen

How many video games do you own: 4
Video game 1 = 1
Video game 2 = 2
Video game 3 = 3
video Game 4 = 5

[1,2,3,4]

no errors, just prints game1

How can i make this happen?

1
  • 3
    You should be reading a tutorial or textbook for these basic-python operations, not asking a question immediately on StackOverflow. This isn't a tutorial service. Commented Mar 26, 2017 at 4:59

1 Answer 1

1

is

x = input("How many video games do you own: ")
list1 = []

for games in range(int(x)):
    name1 = input("Enter game1: ")
    list1.append(name1)

print(list1)
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.