Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Python Exercise Example 75

Python Exercise Example 75

Python 100 Examples Python 100 Examples

**Problem:** Take a break and solve a simple problem.

**Analysis:** None.

Example

#!/usr/bin/python

-- coding: UTF-8 --

if

name

==

'

main

'

:

for

i

in

range

(

5

)

:

n

=

0

if

i

!=

1

:

n

+=

1

if

i

==

3

:

n

+=

1

if

i

==

4

:

n

+=

1

if

i

!=

4

:

n

+=

1

if

n

==

3

:

print

64

i

The output of the above example is:


67

Python 100 Examples Python 100 Examples