Skip to content

Commit f656904

Browse files
committed
python course
1 parent ac48084 commit f656904

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

ListMethods.py

+22-1
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,25 @@
3333
print(a)#like on index 2 item number-3 is deleted
3434

3535
a.remove(0) #here you provide value=0 to remove from list
36-
print(a)#zero is removed from list
36+
print(a)#zero is removed from list
37+
38+
#person name list
39+
#simple way to make list with input() function
40+
41+
p1=input("Enter Person Name \n")
42+
p2=input("Enter Person Name \n")
43+
p3=input("Enter Person Name \n")
44+
p4=input("Enter Person Name \n")
45+
46+
personList=[p1,p2,p3,p4]
47+
print(personList)
48+
49+
#student marks store and print in assending order
50+
51+
student1=int(input("Enter Marks \n"))
52+
student2=int(input("Enter Marks \n"))
53+
student3=int(input("Enter Marks \n"))
54+
student4=int(input("Enter Marks \n"))
55+
marksList=[student1,student2,student3,student4] #first store by use input function
56+
marksList.sort()#sort in assending order by sort() function
57+
print(marksList)#print it

0 commit comments

Comments
 (0)