Skip to content

Instantly share code, notes, and snippets.

@chicagowebmanagement
Created May 15, 2020 04:03
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 chicagowebmanagement/6b0e9f4b09f28e4f08b131d218881769 to your computer and use it in GitHub Desktop.
Save chicagowebmanagement/6b0e9f4b09f28e4f08b131d218881769 to your computer and use it in GitHub Desktop.
import math
class Hexagon:
def __init__ (self, side):
self.perimeter = (side*6)
self.side = side
hex1 = Hexagon(16)
print (hex1.perimeter)
@chicagowebmanagement
Copy link
Author

original code was not working, so this is simpler version

#original code below
import math

class Hexagon():
def init (self, s):
self.side = s

def calculate_perimeter (self):
    return (self.side * 6)

hex1 = Hexagon(6)
print (hex1.calculate_perimeter)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment