xxxxxxxxxx
#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')
xxxxxxxxxx
#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)
xxxxxxxxxx
name = input("What is your name?\n") # Asks the user 'What is your name?' and stores it in the 'name' variable
print("You said your name was " + name)
number = int(input("Please select a random number:\n")) # Will get input as a number
# Will error if the value entered is not a number
# You can use any type of conversion (int(), bool(), float(), etc.) to modify your input
xxxxxxxxxx
# to greet somebody with their name you do like the following
def greet(name):
print(f"Hello, {name} How do you do?")
greet("John Due") # you will get Hello, John Due How do you do?
# if you wanna get the input from the user you can do that too!
name = input("Please enter your name: ")
greet(name) # this takes the input from the user and then greets the user
xxxxxxxxxx
#String
input("Type: ")
#Integer
int(input("Number: "))
#Float
float(input("Decimal Number: "))
xxxxxxxxxx
name = input("Enter your name: ")
#Printing the variable (name)
print("hello",name)
xxxxxxxxxx
# use the function input()
# the parameter is something that would
# output on the screen before the input
name = input('What is your name?')
print('Hello ' + name)
xxxxxxxxxx
# we make the input to take the name of user
name = input("inter your name : ")
# this input to take the age
age = input("inter your age : ")
# the print to say to user hi and this is your age
print(f"hi {name} your age is {age}")