-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathday 5.py
More file actions
43 lines (32 loc) · 738 Bytes
/
day 5.py
File metadata and controls
43 lines (32 loc) · 738 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
def AlphaNumeric(option):
if option == "num":
print("0123456789")
else:
print("the alphabet")
def makerect(w,h,x,y):
Width = w
hieght = h
x = x
y = y
color = getRandomColor();
print "made rectangle"
return (Width, hieght, x , y, color)
def getRandomColor():
return "blue"
class Student():
def __init__(self, n,a,g):
self.name = n
self.age = a
self.grade = g
def promoteGrade(self):
self.grade = self.grade + 1
def changeName(self, newName):
self.name = newName
olly = Student("olly",12,7)
print olly.name
olly.promoteGrade()
print olly.grade
olly.promoteGrade()
print olly.grade
olly.changeName("Obama")
print olly.name