Created
August 30, 2021 05:46
-
-
Save pamelafox/bd4a3c993fbb7699fab65cd00c4ecce0 to your computer and use it in GitHub Desktop.
Can Be President
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""" | |
Implement a function that determines if a candidate can be president. | |
According to the US constitution, a presidential candidate must be at least | |
35 years old and have been a US resident for at least 14 years. | |
The age parameter represents a candidate's age and | |
the residency parameter represents their years of residency. | |
""" | |
def can_be_president(age, residency): | |
""" | |
>>> can_be_president(30, 10) | |
False | |
>>> can_be_president(36, 10) | |
False | |
>>> can_be_president(30, 16) | |
False | |
>>> can_be_president(36, 15) | |
True | |
>>> can_be_president(36, 14) | |
True | |
>>> can_be_president(35, 14) | |
True | |
>>> can_be_president(35, 30) | |
True | |
""" | |
return 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment