Using if statements, relational operators and equality operators to show improper indentation. : if « Statement « Python Tutorial






print "Enter two integers, and I will tell you"
print "the relationships they satisfy."

number1 = raw_input( "Please enter first integer: " )
number1 = int( number1 )

number2 = raw_input( "Please enter second integer: " )
number2 = int( number2 )

if number1 == number2:
   print "%d is equal to %d" % ( number1, number2 )

if number1 != number2:
   print "%d is not equal to %d" % ( number1, number2 )

if number1 < number2:
   print "%d is less than %d" % ( number1, number2 )

if number1 > number2:
   print "%d is greater than %d" % ( number1, number2 )

if number1 <= number2:
   print "%d is less than or equal to %d" % ( number1, number2 )
  
if number1 >= number2:
   print "%d is greater than or equal to %d" % ( number1, number2 )








3.1.if
3.1.1.The if statement is used for conditional execution, and it may include elif and else clauses.
3.1.2.A typical if statement with all three kinds of clauses:
3.1.3.If Statement
3.1.4.using an if-else statement
3.1.5.else Clauses
3.1.6.elif Clauses
3.1.7.Nesting Blocks
3.1.8.Using if statements, relational operators and equality operators to show improper indentation.
3.1.9.Use if statement to compare string