Vitaly
0
Q:

python get input

# Python 3

txt = input("Type something to test this out: ")

# Note that in version 3, the print() function
# requires the use of parenthesis.
print("Is this what you just said? ", txt)
10
#just get input
test = input()

#add a custom message
test = input("Please enter your information: ")

#turning what is inputed into a differnt type of data
test = int(input("Please enter your information: "))
10
#basic user handling for begginers

x = input("your question here") # when someone types something here that answer will be saved and be used for later

# for example 
print(x)
8
var = input("Text: ")
7
# The function 'input()' asks the user for input
myName = input()
16
# Python program showing 
# how to take multiple input 
# using List comprehension 
  
# taking two input at a time 
x, y = [int(x) for x in input("Enter two value: ").split()] 
print("First Number is: ", x) 
print("Second Number is: ", y) 
print() 
  
# taking three input at a time 
x, y, z = [int(x) for x in input("Enter three value: ").split()] 
print("First Number is: ", x) 
print("Second Number is: ", y) 
print("Third Number is: ", z) 
print() 
  
# taking two inputs at a time 
x, y = [int(x) for x in input("Enter two value: ").split()] 
print("First number is {} and second number is {}".format(x, y)) 
print() 
  
# taking multiple inputs at a time  
x = [int(x) for x in input("Enter multiple value: ").split()] 
print("Number of list is: ", x)  
5
# if you want to ask the user to input anything, use the keyword "input"

# example

a = input("What is your name") # the user will be prompted to answer the question 

print(a) # this allows the user to actaully see the question or anything
3
name = input("Input message here")
1
#This will allow the user to type in their name.
name = input("What is your name?")
#or
print("What is your name?")
NAME = input()
1

New to Communities?

Join the community