Skip to content

Instantly share code, notes, and snippets.

@pamelafox
Last active January 12, 2021 23:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pamelafox/74cec783a4c4265f2fa568c770ffeff5 to your computer and use it in GitHub Desktop.
Save pamelafox/74cec783a4c4265f2fa568c770ffeff5 to your computer and use it in GitHub Desktop.
Pairing aging distant pop stars
""" 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