Teo_Yanchev

balls_18-19-2020_exam

Jul 20th, 2020
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. n = int(input())
  2.  
  3. red = 0
  4. orange = 0
  5. yellow = 0
  6. white = 0
  7. black = 0
  8. other = 0
  9. total_points = 0
  10.  
  11. for i in range(1, n+1):
  12. color = input()
  13.  
  14. if color == "red":
  15. red += 1
  16. total_points += 5
  17. elif color == "orange":
  18. orange += 1
  19. total_points += 10
  20. elif color == "yellow":
  21. yellow += 1
  22. total_points += 15
  23. elif color == "white":
  24. white += 1
  25. total_points += 20
  26. elif color == "black":
  27. black += 1
  28. total_points //= 2
  29. else:
  30. other += 1
  31. print(f"Total points: {total_points}")
  32. print(f"Points from red balls: {red}")
  33. print(f"Points from orange balls: {orange}")
  34. print(f"Points from yellow balls: {yellow}")
  35. print(f"Points from white balls: {white}")
  36. print(f"Other colors picked: {other}")
  37. print(f"Divides from black balls: {black}")
Advertisement
Add Comment
Please, Sign In to add comment