python input object code example

Example 1: input in python

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

Example 2: python input

# 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)