Hayyhayy
3/14/2020 - 8:18 AM

Chapter5 #for# statement

  1. In python terms, the variable friends is a list of three strings,
  2. the for loop goes through the list and executes the body once for each of the three strings in the list resulting in thiis output.
  3. for and in are reserved Python keywords,
  4. friend and friends are variables.
friends =  ['Joseph', 'Glen', 'Sally']
for friend in friends:
    print('Happy New Year:', friend)
print('Done!')
n = 10
while True:
    Print(n, end=' ')
    n = n - 1
print('Done!')