0

Why it is wrong?

if question ==yes: print("your question is correct")

30th Mar 2017, 1:21 AM
Azim Jan
Azim Jan - avatar
2 Answers
+ 2
if u want to run print, if question == yes (assuming that yes and question are variables contains same data type) u r missing the indentation. In Python we use indentation to define /mark the scope/block. if question ==yes: print("your question is correct")
30th Mar 2017, 1:57 AM
Eranga
Eranga - avatar
+ 1
That code could be wrong for 2 reasons. 1- The indentation (as already explained by Eranga). 2- The answer to the question (yes) is probably a string and a string is always written between double quotes like this: "yes" The code should look like this: if question == "yes": print("your question is correct")
30th Mar 2017, 2:25 AM
Jeremie Tamburini
Jeremie Tamburini - avatar