Nested if statement : If : Language Basics : Python examples (example source code) Organized by topic

C++
PHP
Python
Python Home »  Language Basics   » [  If  ]  Screenshots 
 



Nested if statement



x = 1

if x:
    y = 2
    if y:
        print 'block2'
    print 'block1'



           
       
Related examples in the same category
1.  if-else structure if-else structure
2.  if-elif-else structure if-elif-else structure
3.  if structure if structure
4.  if Statements: if, elif and else if Statements: if, elif and else
5.  Boolean operation in if Boolean operation in if
6.  elif demo elif demo
7.  if with else if with else
8.  If statement: a dictionary-based 'switch' If statement: a dictionary-based 'switch'
9.  Leap Year checker Leap Year checker
























Home| Contact Us
Copyright 2003 - 04 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.