CSC111 Programs Created in Class 2018
D. Thiebaut (talk) 12:30, 31 January 2018 (EST)
1/30/18
# wedWeek1.py
# D. Thiebaut
# Demo program week 1
# variables
age = 20
year = 2018
# compute year born
print( year - age )
# example of for loop
for name in [ "smith", 23, 3.14159, "hello" ]:
print( name )
"""
challenge: print the following lines
***
Mae
*****
Alice
*******
Felicia
"""
for name in [ "Mae", "Alice", "Felicia" ]:
print( '*' * len( name ) )
print( name )
"""
new challenge: print the following lines
*
Mae
********
Alice
****
Felicia
**
"""
for name in [ "*", "Mae", "********", "Alice", "****", "Felicia", "**" ]:
print( name )