Answers for "python how make inputs with for loop"

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
0

taking input in for loop in python

n, m = list(map(int, input().split()))
arr = []
for _ in range(n):
    l = list(map(int, input().split()))[:m]
    arr.append(l)
Posted by: Guest on October-15-2020
0

python how make inputs with for loop

# I am going to do a thing where you can take and save different inputs with 
# A foor loop


# This is an example:

moves = []

for x in range(2):
  move = input("What is your move, rock, paper or scissors?")
  moves.append(move)
 
if moves[0] == moves [1]:
  print("Tie!")
 
# The rest is pretty obvious, this is a rock paper scissors game if you did not 
# realise
Posted by: Guest on September-21-2021

Code answers related to "python how make inputs with for loop"

Python Answers by Framework

Browse Popular Code Answers by Language