Python Tutorial 24 – Nested if Statement


Video is ready, Click Here to View ×

Python allows us to have nested if statements. This means that we can put an if statement within an if statement. Be careful to pay attention to the indents…They are very important! If we do not put the proper amount of space for our program then we will cause errors.

More content! –

Tech/Business Facebook –

Personal Twitter –

Subscribe for more –

Amazing Web…

11 thoughts on “Python Tutorial 24 – Nested if Statement

  1. >>> score = 9001
    >>> if score > 100:
    print('you rock my socks off, you have enough points!')
    if money >= 50:
    print('you win')
    print('you have a high enough score but you do not have enuff muniuz')
    print('loserrrrr') <<< see same fucking thing as you.

  2. Traceback (most recent call last):
    File "<pyshell#100>", line 3, in <module>
    if money >= 50:
    NameError: name 'money' is not defined <<< i get this error even though i put the same exact thing as you.

  3. Great video on explaining nested if statements. It would have been much easier on the eyes and easier to visualize if you used the file editor instead of the interactive shell. That way all the indentation would line up (instead of the else being to the left of the >>>

Leave a Reply

Your email address will not be published. Required fields are marked *