Python Programming by flow Knowledge

Python Programming by flow Knowledge

Author:flow, Knowledge
Language: eng
Format: epub
Publisher: Knowledge flow
Published: 2015-05-02T16:00:00+00:00


If statement

Contains logical expression.

Utilizes these expressions and converts them into a result after comparison.

Syntax

If expression:

Statement

If flow table

Program

#!/usr/bin/python

var1 = 100

if var1:

print "1 - Got a true expression value"

print var1

var2 = 0

if var2:

print "2 - Got a true expression value"

print var2

print "Good bye!"

Output

1 - Got a true expression value

100

Good bye!

If else statement

If and else are combined.

Else provide an option to the if statement.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.