Advertisement
zhongnaomi

find a colour in a set

Feb 1st, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.29 KB | None | 0 0
  1. count = 0
  2. colours = ['White','Tan', 'Yellow','Orange',    'Red',  'Pink','Purple','Blue','Red','White',   'Tan', 'Yellow', 'Orange',  'Red',  'Pink','Purple','Blue' ]
  3.  
  4.  
  5.  
  6.  
  7. for mycolor in colours:
  8.     if mycolor == 'Red':
  9.         count += 1
  10. print("{0} red colours in this colours set ".format(count))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement