-
Notifications
You must be signed in to change notification settings - Fork 0
/
plotmark.py
42 lines (38 loc) · 985 Bytes
/
plotmark.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
def plot():
import matplotlib.pyplot as plt
import csv
def plotm():
f=open('markm.csv','r')
rd=csv.reader(f,delimiter=',')
x=[]
y=[]
for row in rd:
x.append(row[0])
y.append(row[1])
plt.bar(x,y,color='blue')
plt.xlabel('SUBJECT')
plt.ylabel('MARKS')
plt.show()
def plott():
f=open('markt.csv','r')
rd=csv.reader(f,delimiter=',')
x=[]
y=[]
for row in rd:
x.append(row[0])
y.append(row[1])
plt.bar(x,y,color='blue')
plt.xlabel('SUBJECT')
plt.ylabel('MARKS')
plt.show()
while True:
print('TO EXIT ENTER ANY OTHER NUMBER THAN 1,2')
print('1.MONTHLY MARK')
print('2.TERMINAL MARK')
ch=int(input('enter choice'))
if ch==1:
plotm()
elif ch==2:
plott()
else:
break