xxxxxxxxxx
x = input()
# This will take you to shell where you input a value for x
print(x)
# Print's the value you typed
y = input('Enter a number: ')
# Will print 'Enter a number: ' to the shell and then wait for you
# to enter a value (Does not have to be a number)
# Copy the code and try it
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
#String
input("Type: ")
#Integer
int(input("Number: "))
#Float
float(input("Decimal Number: "))
xxxxxxxxxx
# Taking string input
a = input("Enter a string: ")
print("String is: ", a)
# Taking integer input
b = int(input("Enter an integer: "))
print("Integer is: ", b)
# Taking float input
c = float(input("Enter a float value: "))
print("Float value is: ", c)
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}")