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

Python Exercise Example 77

Python Exercise Example 77

Python 100 Examples Python 100 Examples

**Problem:** Output a list in a loop

**Analysis:** None.

Program source code:

Example

#!/

usr

/

bin

/

python

-*-

coding

:

UTF

8

-*-

if

name

== '

main

':

s

=

[

"

man

"

,

"

woman

"

,

"

girl

"

,

"

boy

"

,

"

sister

"

]

for

i

in

range

(

len

(

s

)

)

:

print

s

[

i

]

The output of the above example is:


man
woman
girl
boy
sister

Python 100 Examples Python 100 Examples