python inputs code example
Example 1: python input
name = input('Please enter your name: ')
print(name)
if name == 'Joe':
print('Joe Mama')
Example 2: how to get user inout in python
test = input()
test = input("Please enter your information: ")
test = int(input("Please enter your information: "))
Example 3: python how to use input
x = input("your question here")
print(x)
Example 4: python input
myName = input()
Example 5: input in python
input("What's your name?: ")
name = input("What is your name? ")
print("Hello," , name , ", I'm dad!")
name = input("What is your name? )
if name == "Dad": # Now if sombody inputs 'Dad' as there name:
print("Hi dad I'm- wait a minute...") # it will say this
else: # If a user prints anything else:
print("Hi" , name , "I'm dad!") # It will output this!
# What if I want to add multiple names? Well, that's entirly possible, with the elif statment
if name == "Dad": # If the user inputs "Dad" as their input:
print("Hi Dad, I'm- stop trying to trick me D:<") # It will output this
elif name == "Doggo": # If the name is "Doggo":
print("Hi doggo- wait your not supposed to talk?") # It will output this:
# Using the elif statment, we can make an entirley different with only one question asked
else:
print("Hello, ", name, "!")
Example 6: python input function
answer = input('What is your name?')