Answers for "how to make inputs in a loop in python"

1

how to make inputs in a loop in python

for i in range(1,6): 
    globals()['string%s' % i] = input("Enter something: ")
    
#You can change how many times the loop iterates

print(string3)#This will return whatever was inputed
			  #in the third iteration of the loop
Posted by: Guest on January-13-2021

Code answers related to "how to make inputs in a loop in python"

Python Answers by Framework

Browse Popular Code Answers by Language