Last active
August 24, 2017 06:46
-
-
Save mattbell87/bf9aec8b4aa96ec59fc755bd643aa34e to your computer and use it in GitHub Desktop.
My first python app
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
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