Last active
January 12, 2021 23:54
-
-
Save pamelafox/74cec783a4c4265f2fa568c770ffeff5 to your computer and use it in GitHub Desktop.
Pairing aging distant pop stars
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
""" Check your work by running python -m doctest -v popstar.py """ | |
def gen_popstar_name(last_name, street, last_food): | |
"""Your pop star name is your last name followed | |
by the name of the street your grew up on followed | |
by the last food you ate. | |
The only whitespace should be between each of the | |
three parts, and the name should be uppercase. | |
>>> gen_popstar_name("fox", "city lights", "bananas") | |
FOX CITYLIGHTS BANANAS | |
>>> gen_popstar_name("gray", "pomona", "rice triangle") | |
GRAY POMONA RICETRIANGLE | |
""" | |
return None | |
def calculate_age(year, month, day): | |
"""Returns the age according to a birthdate. Month and day are 1-indexed. | |
>>> calculate_age(1984, 6, 24) | |
36 | |
""" | |
return -1 | |
def calculate_distance_from_campus(lat, lng): | |
"""Returns the rounded distance (km) between a lat/lng and Berkeley. | |
You may want to make a generic distance calculation function first, | |
using the Haversine formula. | |
>>> calculate_distance_from_campus(43.0352286, -76.1742993) | |
3895 | |
""" | |
return 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment