Boston Python Workshop 6/ColorWall handout: Difference between revisions

imported>Jesstess
(Created page with "===ColorWall goals=== * practice for loops * practice using functions * practice implementing functions * have fun experimenting with Python code that produces graphical resu...")
 
imported>Jesstess
 
Line 111:
 
<pre>
>>> for iname in range(80)["Alice", "Bob", "Cassie", "Deb", "Ellen"]:
... if iname[0] %in 9 == 0"AEIOU":
... print i,name + "is divisiblestarts with bya 9vowel."
...
Alice starts with a vowel.
0 is divisible by 9.
Ellen starts with a vowel.</pre>
9 is divisible by 9.
18 is divisible by 9.
27 is divisible by 9.
36 is divisible by 9.
45 is divisible by 9.
54 is divisible by 9.
63 is divisible by 9.
72 is divisible by 9.</pre>
 
====<code>for</code> loops inside <code>for</code> loops====
Anonymous user