-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschool.py
82 lines (78 loc) · 3.17 KB
/
school.py
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import random
class school:
def __init__(self,name):
self.name=name
class student:
def __init__(self,name,surname,number,diciplinePoint,className,lessons={"Math":0,"English":0}):
self.name=name
self.surname=surname
self.number=number
self.diciplinePoint=diciplinePoint
self.className=className
self.lessons=lessons
def dicipline(self):
dicipline=input("Student Went A principle?(Please write yes or no!!: )")
if dicipline=="yes":
self.diciplinePoint-=10
if self.diciplinePoint<=0:
print("The student is not a student anymore in this school")
self.name=None
self.surname=None
self.number=None
self.diciplinePoint=None
self.className=None
else:
print("The student's dicipline point (-10 points) : ",self.diciplinePoint)
elif dicipline!="yes" or dicipline=="no":
print("Do not busy !")
def show(self):
print("""
// Student Info's//
Name: {}
Surname: {}
Number: {}
ClassName: {}
Dicipline Point: {}
""".format(self.name,self.surname,self.number,self.className,self.diciplinePoint))
def changeNotes(self):
results=input("Please choose the lesson that you want to change the note ('Math' or 'English') :")
if results=="Math":
self.lessons["Math"]=int(input("Please write new note : "))
if 0<=self.lessons["Math"]<=100:
print("You add the note successfully. New Math Note:",self.lessons["Math"])
else:
print("You can't change the note!! ")
self.lessons["Math"]=0
elif results=="English":
self.lessons["English"]=int(input("Please write new note : "))
if 0<=self.lessons["English"]<=100:
print("You add the note successfully. New English Note:",self.lessons["English"])
else:
print("You can't change the note!! ")
self.lessons["English"]=0
else:
print("There is not a lesson ")
def showNotes(self):
print("""
// Your Notes
Math Note: {}
English Note: {}
""".format(self.lessons["Math"],self.lessons["English"]))
def Teacher(self):
num=random.randint(1,2)
if num==1:
print("Busted")
self.diciplinePoint-=2
if num==2:
print("Wrong Alert!")
class teachers:
def __init__(self,name,surname,password=123456):
self.name=name
self.surname=surname
self.password=password
def teacherInfo(self):
print("""
//Teacher's Infos
Name: {}
Surname: {}
""".format(self.name,self.surname,))