-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDatatypes.py
More file actions
41 lines (24 loc) · 874 Bytes
/
Copy pathDatatypes.py
File metadata and controls
41 lines (24 loc) · 874 Bytes
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
#Write a program to manipulate List data
A=['Shreyas','Atharv','Abhishek','Amit','Yashraj','abc',64,44,29,66,00]
print("\n\nList A :",A[:])
print("List A : 2 to 5",A[2:6])
print("List A In Reverse:",A[::-1])
A.append('Abhishek')
print("List A After Appending :",A[:])
A.insert(4,'Nikhil')
print("List A After Inserting :",A[:])
A.pop(4)
print("List A After Poping :",A[:])
A.remove('abc')
print("List A After Removing :",A[:])
del A[0]
print("List A After Deleteing :",A[:])
A.clear()
print("List A After Clearing :",A[:])
#Write a program to manipulate Tuple data
B=("Shreyas","Atharv","Abhishek","Amit","Yashraj","abc","Amit",64,44,29,0)
print("\n\nTuple B:",B)
print("Tuple B: 2 to 5",B[2:6])
print("Tuple B in Reverse:",B[::-1])
print("Count of Amit is :",B.count('Amit'))
print("Index of Amit",B.index('Amit'))