2/15 Help! i checked related answers and found no why


#1


#2

after if and else you need to indent:

if condition:
    do something
else:
    do something else

the indent refers to the tab/spaces at the beginning of the line


#3

it worked. thank a lot. I missed the use of space.


#4

could you tell me whether i can put False first and else True
i found it won't work if i turn over. thank you very much.


#5

No, not in the exercise. The exercise wants you to do things a certain way


#6

thank you very much. i wonder how to use this line in practice. could you give a context where it will be used, because i can't recognize the input an output.


#7

Well, this exercise is to practice with if and else, which you will need. A lot. If you want to write a simple game to determine i there is a hit, you could use if to determine if there is a hit. You could use if to check/validate user input, and many many more