python input in function code example

Example 1: python input

# The function 'input()' asks the user for input
myName = input()

Example 2: python input function

answer = input('What is your name?')

Example 3: input python

name = input("Enter your name: ")

#Printing the variable (name)
print("hello",name)

Example 4: input in python

age = input("Your age: ")
print("Your age is: " + age)

# defines input as a string and prints it out

Example 5: input in python

#input or question, is used to ask question

ans = input('Who invented Microsoft?')

#An if statement

if(ans == 'Bill Gates'):
  print('You got the answer')