+ 2

How do inputs work?

https://code.sololearn.com/chS6G4ClUy88/?ref=app My first code and idk how to fix that I dont get a Error if I Dont create a 2nd line. Like how can I stop it from crashing when nothing is entered at my 2md input? Thanks for the help.

28th Feb 2019, 12:59 PM
Niclas
Niclas - avatar
4 ответов
+ 4
Your second input needs some kind of input. After writing in your first input, hit return to give the second input a value of ""
28th Feb 2019, 1:03 PM
Nathan Lewis
Nathan Lewis - avatar
+ 8
Seniru Pasan z will always be True if you do it like this. 'or' returns first value whose bool value is True
28th Feb 2019, 2:24 PM
Mert Yazıcı
Mert Yazıcı - avatar
+ 3
Nathan Lewis ok thank you but ist there any way that I can fix it so that I dont even have hit return? Is there something like to give a value to z if nothing is entered idk.. But thank u for your help
28th Feb 2019, 5:21 PM
Niclas
Niclas - avatar
+ 1
Use this z = "True" or str(input("If u had birthday this year write True !\n"))
28th Feb 2019, 2:17 PM
Seniru
Seniru - avatar