python user input code example

Example 1: python input

#Collecting The Input As A Variable:#
name = input('Please enter your name: ')
#Printing The Variable:#
print(name)
#Checking The Variable And Printing Accordingly:#
if name == 'Joe':
  print('Joe Mama')

Example 2: python user input

input('ENter question here')

Example 3: python user input

x = input("y/n")

Example 4: python user input

var = raw_input()
# OR
var = input()

""" raw_input can only be a string, but input can be a string, 
integer, or variable. """

Example 5: python user input

user = input("yes, no\n")

Example 6: python user input

user = input("yes, no\n")