Advertisement
fkudinov

11. Majority / Вирішуємо задачі на Python CheckIO Українською

Dec 7th, 2023
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.57 KB | Source Code | 0 0
  1. def is_majority(items) -> bool:
  2.     return True
  3.  
  4.  
  5.  
  6. print("Example:")
  7. print(is_majority([True, True, False, True, False]))
  8.  
  9. # These "asserts" are used for self-checking
  10. assert is_majority([True, True, False, True, False]) == True
  11. assert is_majority([True, True, False]) == True
  12. assert is_majority([True, True, False, False]) == False
  13. assert is_majority([True, True, False, False, False]) == False
  14. assert is_majority([False]) == False
  15. assert is_majority([True]) == True
  16. assert is_majority([]) == False
  17.  
  18. print("The mission is done! Click 'Check Solution' to earn rewards!")
Tags: checkio
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement