forked from cyberwest/Ravensbourne
-
Notifications
You must be signed in to change notification settings - Fork 0
/
feelinclassy.py
21 lines (15 loc) · 844 Bytes
/
feelinclassy.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
######################### feelinclassy: a class containing functions to print various messages #########################
##### We define the class here ####
class feelinClassy(object):
# The 'init' function (or METHOD) is the first thing that runs whenever the class is called
def __init__(self):
self.howclassy = raw_input("How classy are you feeling? ")
print "You're feeling "+ self.howclassy + " classy!"
# Other functions, or methods, are also defined inside the class
def superclassy(self):
print "I AM FEELING SUPER CLASSY"
####################################
# We can create an instance of the 'feelinClassy' class which makes the 'init' function inside the class run
myclass = feelinClassy()
# We can also call other methods or functions inside the class like this
myclass.superclassy()