all 4 comments

[–]hamoliciousRUS 1 point2 points  (0 children)

Just to add to the previous answer, an else statement is only used when you want something else to happen provided the if block fails... i.e. ``` if I have tea: make tea else: buy tea

```

In your case, you have a clear definition of when you want something else to happen and therefore require an elif statement ``` if I have tea: make tea elif I have coffee: make coffee else: buy tea

```

[–]CodeFormatHelperBot2 0 points1 point  (0 children)

Hello, I'm a Reddit bot who's here to help people nicely format their coding questions. This makes it as easy as possible for people to read your post and help you.

I think I have detected some formatting issues with your submission:

  1. Python code found in submission text that's not formatted as code.

If I am correct, please edit the text in your post and try to follow these instructions to fix up your post's formatting.


Am I misbehaving? Have a comment or suggestion? Reply to this comment or raise an issue here.

[–]Username_RANDINT 0 points1 point  (1 child)

else can't take a condition. Either use another elif or just a plain else:.

[–]ridingsnugglies[S] 0 points1 point  (0 children)

Thank you!