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

Home
Python Tutorial
1.Introduction
2.Data Type
3.Statement
4.Operator
5.String
6.Tuple
7.List
8.Dictionary
9.Collections
10.Function
11.Class
12.File
13.Buildin Function
14.Buildin Module
15.Database
16.Regular Expressions
17.Thread
18.Tkinker
19.wxPython
20.XML
21.Network
22.CGI Web
23.Windows
Python Tutorial » Statement » if 
3.1.8.Using if statements, relational operators and equality operators to show improper indentation.
print "Enter two integers, and I will tell you"
print "the relationships they satisfy."

number1 = raw_input"Please enter first integer: " )
number1 = intnumber1 )

number2 = raw_input"Please enter second integer: " )
number2 = intnumber2 )

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
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.