Help needed in for loop


#1



Replace this line with your code.


#2

please post your code properly and tell us your problem so we can help you :slight_smile:


#3

Please make your question clear and state what your problem is so that we can help you solve things out :slight_smile:


#4

names = []
number = int(input("Enter the number of names:"))
for i in range(number):
name = input('Enter the name',i) # as the loop runs i want to display the number initialized in loop
names.append(name)
print(names)
for i in range(number):
print(name[i])

This is the code. i think there is something error in line 4 (at ,i).


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.