For example, if the program asks the user to press enter on their keyboard to continue, the program can recognise it & continue. I'm still a student so not really sure, is it possible..?
Asked
Active
Viewed 54 times
-2
-
1Possible duplicate of [Python: user input and commandline arguments](https://stackoverflow.com/questions/70797/python-user-input-and-commandline-arguments) – Shai Jul 12 '17 at 10:53
3 Answers
0
You need to use the input statement and assign the input to variables like this:
name = input("What's your name? ")
print("Hello there, " + name + "!")
It's that simple!
TomServo
- 6,759
- 5
- 27
- 41
0
Use the input function as well as if statements:
x = input("What's 1+1?")
if x == 2:
print("correct")
else:
print("Wrong")
BloodViolet
- 67
- 2
- 10