Python:For Tutorial 4

From Progzoo
Revision as of 13:45, 14 August 2009 by 08003008 (talk | contribs) (Created page with '{{For Tutorial}} ==An Array of Integers== <question> You can loop over an Array without using an index: for v in a <p class='imper'>Change the program so that it prints twice th...')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

An Array of Integers

You can loop over an Array without using an index:

for v in a

Change the program so that it prints twice the value:

4
14
10
6


[Font] [Default] [Show] [Resize] [History] [Profile]

Another Array of Integers

Change the program so that it prints the number and twice the value:

2 4
7 14
5 10
3 6


[Font] [Default] [Show] [Resize] [History] [Profile]

An Array of String

Write out each string in the Array:

Hydrogen
Helium
Lithium
Beryllium


[Font] [Default] [Show] [Resize] [History] [Profile]