Skip to content

Instantly share code, notes, and snippets.

@mattbell87
Last active August 24, 2017 06:46
Show Gist options
  • Save mattbell87/bf9aec8b4aa96ec59fc755bd643aa34e to your computer and use it in GitHub Desktop.
Save mattbell87/bf9aec8b4aa96ec59fc755bd643aa34e to your computer and use it in GitHub Desktop.
My first python app
class Person:
name = ""
def __init__ (self, name):
self.name = name
def sayHi(self):
print("Hello, my name is {}").format(self.name)
def countTo(self, number):
print("{} is counting to {}").format(self.name, number)
for i in range(1, number+1):
print(i)
p = Person('Bob')
p.sayHi()
p2 = Person('Mike')
p2.sayHi()
p.countTo(10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment