-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpro3.py
More file actions
102 lines (79 loc) · 1.87 KB
/
Copy pathpro3.py
File metadata and controls
102 lines (79 loc) · 1.87 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
list = [1,2,3,4,5,6]
print(type(list))
print(list)
list[3] = 10
print(list)
print(list[4])
list[2]="python"
print(list)
print(len(list))
# marks=[45,78,90,67,34]
# print(marks)
# print(marks[3:len(marks)])
# marks.append(100)
# print(marks)
# marks.sort()
# print(marks)
# marks.reverse()
# print(marks)
# marks.sort(reverse=True)
# print(marks)
# marks.insert(3,18)
# print(marks)
# marks.remove(100)
# print(marks)
# marks.pop(0)
# print(marks)
# marks.append(100)
# print(marks)
# tuple = (1,2,3,4,5,6)
# # print(tuple)
# print(type(tuple))
# tuple= (1,)
# print(tuple)
# tf= (4,8,0,7,"q")
# print(tf)
# tf= ()
# print(tf)
# print(tf[0:4])
# print(tf[ : 2: 3])
# print(tf.index(7))
# print(tf.count(8))
# wAPto askthe user to enter namesof their 3 favorite movies &store themin alist.
movies = []
mov1= input("enter first movie name:")
mov2= input("enter second movie name:")
mov3= input("enter third movie name:")
movies.append(mov1)
movies.append(mov2)
movies.append(mov3)
print(movies)
video= []
vid1=input("enter first video name:")
video.append(vid1)
vid2=input("enter second video name:")
video.append(vid2)
vid3=input("enter third video name:")
video.append(vid3)
print(video)
audio=[]
audio.append(input("enter firt audio name:"))
audio.append(input("enter second audio name:"))
audio.append(input("enter third audio name:"))
print(audio)
# wAP to check if alist contains apalindrome of elements. (Hint: use copy( )method)
p =[1,"abc","abc",1]
q=p.copy()
q.reverse()
if(q==p):
print("palindrome")
else:
print("not palindrome")
# wAP to count the numberof students with the “A” grade in the following tuple.
# [”C”, “D”, “A”, “A”, “B”, “B”, “A”]
grade=("C", "D", "A", "A", "B", "B", "A")
print(grade.count("A"))
# store the above values in alist &sort them from “A” to “D”.
ch=["C", "D", "A", "A", "B", "B", "A"]
ch.sort()
print(ch)