0

A simple one

Hi guys. Why this code do not run on the playground? print("What'\ns your gender?\n1-male\n2-female") user_input = input("Enter: ") if user_input == "1": print("Bad") else: print ("You are the day flower") I am begginer, may it lacks something that i can't see. Thanks.

2nd Feb 2019, 2:22 PM
Ivan Zanoth
Ivan Zanoth - avatar
1 Odpowiedź
+ 1
https://www.sololearn.com/learn/JUMP_LINK__&&__Python__&&__JUMP_LINK/2277/ "Python uses indentation (white space at the beginning of a line) to delimit blocks of code. Other languages, such as C, use curly braces to accomplish this, but in Python indentation is mandatory; programs won't work without it. As you can see, the statements in the if should be indented." Here you can find an example of the code with the else section too: https://www.sololearn.com/learn/Python/2278/
2nd Feb 2019, 2:39 PM
portpass