woebegone
0
Q:

python keyboard input

var = input("Text: ")
7
#variable for the input:
variable_name = input("please add your input: ")
print(variable_name)

#example
#output(Type Hi please: ")
#print(output)
#Output will be Hi if you typed hi
2
# creating an empty list 
lst = [] 
  
# number of elemetns as input 
n = int(input("Enter number of elements : ")) 
  
# iterating till the range 
for i in range(0, n): 
    ele = int(input()) 
  
    lst.append(ele) # adding the element 
      
print(lst) 
3
# To get input from the user in python:

x = input("Optional prompt for input here")
0

New to Communities?

Join the community