Answers for "how to check if user pressed enter in python"

0

how to check if user pressed enter in python

# credit to the Stack Overflow user in source link

text = input("type in enter")  # or raw_input in python2
if text == "":
    print("you pressed enter")
else:
    print("you typed some text before pressing enter")
Posted by: Guest on May-27-2021

Code answers related to "how to check if user pressed enter in python"

Python Answers by Framework

Browse Popular Code Answers by Language