-
-
Save codecademydev/108828bf9cb1969d3856e2444727185a to your computer and use it in GitHub Desktop.
Codecademy export
This file contains 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
class Circle: | |
pi = 3.14 | |
def __init__(self, diameter): | |
print("Creating circle with diameter {d}".format(d=diameter)) | |
# Add assignment for self.radius here: | |
self.radius = diameter / 2 | |
def circumference(self): | |
return 2 * self.pi * self.radius | |
medium_pizza = Circle(12) | |
teaching_table = Circle(36) | |
round_room = Circle(11460) | |
print(medium_pizza.circumference()) | |
print(teaching_table.circumference()) | |
print(round_room.circumference()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment