Printing a message if there is no input | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Printing a message if there is no input

Is there a way I can get a message that gets printed if there is no user input? I’ve tried using: User_input=str(input()) If User_input==None: Print(“Please enter a value”) else: Print(User_input) But it doesn’t seem to work. Is there a way I can get this to work?

22nd Jun 2020, 5:30 AM
•—• • •-• ••• —- -•
•—• • •-• ••• —- -• - avatar
2 Answers
+ 4
You wrote if using uppercase I and you wrote print using uppercase P and the quotes you used in your print functions do not work try using these " " and these' '
22nd Jun 2020, 5:49 AM
boolean
boolean - avatar
22nd Jun 2020, 5:42 AM
Oma Falk
Oma Falk - avatar