Empty Input Python | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Empty Input Python

How do I use an if statement to check if user input is empty? It keeps giving me an error whatever I try.

15th Mar 2019, 9:48 AM
DandyOrang
DandyOrang - avatar
2 Answers
+ 1
In which language? Can you add more info, we will able to help you with the problem.
15th Mar 2019, 9:56 AM
Martin Yakimov
Martin Yakimov - avatar
+ 5
Adding programming language tag will increase your chances to get better help. It'll depend upon what the input function returns if no input provided. In case of Python it returns an empty string so you can check the length of whatever returned if it's not 0.
15th Mar 2019, 9:59 AM
Шащи Ранжан
Шащи Ранжан - avatar