Learn Before
Code

Demonstration of input() function

x = input("Enter your credit card number: ")
  • Box appears prompting user with text: (Enter your credit card number: )
  • User enters credit card number
print(x) # User's CCN is printed.

The variable the input() expression is assigned to can be used in a print expression sentence as well:

print("Hello, my credit card number is", x) #Prints: Hello, my credit card number is (*inputted CCN).

0

1

Updated 2020-09-03

Tags

Data Science