Skip to content

Commit 1221d44

Browse files
committed
coding_Exercise24.py
1 parent 4c69bec commit 1221d44

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

coding_Exercise24.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
student_data=[
2+
{
3+
"Name":"Ram",
4+
"roll_no":10,
5+
"age":20,
6+
"course":"Python"
7+
},
8+
{
9+
"Name":"Mohan",
10+
"roll_no":20,
11+
"age":22,
12+
"course":"Java",
13+
"phone_no":[8695757,6574]
14+
}
15+
]
16+
def add_new_student(name,rollno,age,course_opted):
17+
new_student={}
18+
new_student["Name"]=name
19+
new_student["roll_no"]=rollno
20+
new_student["age"]=age
21+
new_student["course"]=course_opted
22+
student_data.append(new_student)
23+
24+
add_new_student("Shyam",22,18,"C++")
25+
print(student_data)

0 commit comments

Comments
 (0)