-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathassn4.py
More file actions
68 lines (50 loc) · 1.31 KB
/
assn4.py
File metadata and controls
68 lines (50 loc) · 1.31 KB
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
#l Write a program that grades a students end of semester tests.
# The student does 3 papers in total and each paper gets a grade (A,B,C,D,0 or F)
# Store the students marks and grades in a text file.
# Determine a grade for each paper.
# Determine over all grade for the student.
# Determine Average score for the student
# Determine total score.
name=raw_input("my name is: ")
def file_open("C:/Users/ProBook/Documents/python-tutorials/grade.txt","r"):
data=file.readlines()
print(data)
return data
for i in range(0,4)
score = input("What is "+str(i)+"th mark?: ")
def compute_grade(marks list):
if marks=>80:
grade="A"
credit=5
elif marks>=70 and marks<80:
grade="B"
credit=4
elif marks>=60 and marks<69
grade="C"
credit=3
elif marks>=50 and marks<59
grade= "D"
credit=2
elif marks>=40 and marks<49
grade="O"
credit=1
else:
grade="F"
credit=0
total_grade=grade+total_grade
total_credit=credit+credit+credit
def average("credit_total/3")
print("average is %d"%average)
def determining_performance(grade):
if grade >= 5:
print("good performance")
elif grade >=2 and grade < 5:
print("average score")
else:
print("poor performance")
# i=0
# for i in range(0,2):
# # current_file=files[i]
# # d=opens_a_file(current_file)
# # i=i+1
# # print (d)