Skip to content

Commit 09e7dfd

Browse files
committed
Re Stuff
1 parent d049233 commit 09e7dfd

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Hello.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,15 @@
22
txt = "Stefan:14*Math:6,5,4 Biology:4,5,7 ;Prasi:15*Math:6,3,4 Biology:3,5,7 ;"
33
for x in txt.split(";")[:-1]:
44
grades = {}
5+
name = re.search(r"\w+",x).group()
6+
age = re.search(r"\d+",x).group()
7+
ls.append(Students(name,age))
58
x = re.search(r"\*.+",x).group()
69
x = x[1:]
710
subject = x.split(" ")[:-1]
811
for y in subject:
9-
name = re.search(r"[a-zA-Z]+",y).group()
12+
sub = re.search(r"[a-zA-Z]+",y).group()
1013
grade = re.findall(r"\d+",y)
11-
grades[name] = grade
14+
grades[sub] = grade
15+
ls[-1].grades = grades
16+

0 commit comments

Comments
 (0)