Advertisement
Guest User

Untitled

a guest
Feb 13th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.33 KB | None | 0 0
  1. #Question 6
  2.  
  3. number = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)
  4. count_odd = 0
  5. count_even = 0
  6.  
  7. for number in (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15):
  8.     if number % 2 == 0:
  9.         count_even += 1
  10.     else:
  11.         count_odd += 1
  12. print "%s even numbers" % count_even
  13. print "%s odd numbers" % count_odd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement