and have a question that I'm trying to clarify, is using an elif statement good for when you have to use else and if at the same time?
Yes, other languages support else if, since there's nothing as a switch in python, that's your best way to go.
if you mean that you will need your code to execute regardless of an if being true or not, simply put else.
So for example: if thing ==: print('Hi') Else: Print('Wrong') if blah: Print(blah) I can just use elif here, right?
Обсуждают сегодня