What Is The Output ? Mylist (1,2,3,4,5,6,7,8,9,10) For I in Range (0, Len (Mylist) ) : If I%2 0: Print (Mylist (I) )
What Is The Output ? Mylist (1,2,3,4,5,6,7,8,9,10) For I in Range (0, Len (Mylist) ) : If I%2 0: Print (Mylist (I) )
Mylist=[1,2,3,4,5,6,7,8,9,10]
For I in range(0,len(mylist)):
If i%2==0:
Print(mylist[i])
2.
a = [1, 2, 3, 4, 5, 6, 7, 8, 9]
b = a.pop(5)
c = a.pop( )
d = a.pop(-1)
print(b)
print(c)
print(d)
print(a)
3.
Write the output of the following:
a = [11,42,31,14]
print(max(a))
print(min(a))
print(a.index(42))
4.
Write the output of the following
>>> a = [1,2,3,4]
>>> a.append([7,8])
>>> a
5.
b = “Practice Questions of List in Python“
a=list(b)
1. print(a)
2. print(len(a))
3. print(a[1:4])
4. print(a[1:7])
5. print(a[3:])
6. print(a[:5])
7. print(a[4:17])
8. print(a[-2:-5:-1])
9. print(a[1:7:1])
10. print(a[1:7:2])
11. print(a[-5:])
12. print(a[:4])
13. print(a[-2:-5:-2])
14. print(a[11:15])
15. print(a[:])
16. print(a[::2])
17. print(a[-5:-1])
18. print(a[7:1:-1])
19. print(a[3:-3])
20. print(a[30:40])
21. print(a[17:-1])
22. print(a[10::-1])
6.
10. The record of a student (Name,Roll No,Marks in five subjects and percentage of marks ) is
stored in the following list:
Record=[“Raman”,”A-35”,[55,95,99,72,69],78.8]
Write Python statements to retrieve the following information from the list Record
(a) Percentage
(b) Marks in the 5th subject
(c) Maximum marks of the student.
(d) Roll no of the student
(e) Change the name of the student from Raman to Raghav