xxxxxxxxxx
print("What is your name?")
name = input()
print(name) # This will print out whatever the user typed
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
# 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
# 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
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
#The input command will popup/print the text placed inside the brackets.
#After the text you can type anything and press enter.
#Then the stuff written in the ansfer field will be saved as the function value.
x = input("write anything after this: ")
print(x)
#This code will first print the stuff written in input (write anything after this:).
#Then it will store the text as the x value.
#Then it will print it.
xxxxxxxxxx
# Python program showing
# a use of input()
val = input("Enter your value: ")
print(val)
xxxxxxxxxx
#Input in python
name = input('What is your name')
print('Hello'+ name + ' !')