forked from powerexploit/Awesome-Python-Scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlist_tuple_dict.py
More file actions
52 lines (36 loc) · 858 Bytes
/
Copy pathlist_tuple_dict.py
File metadata and controls
52 lines (36 loc) · 858 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
42
43
44
45
46
47
48
49
50
51
52
#first program of list
item1=56
item2="main"
listoftwoitems=[item1,item2]
print("output:\n",listoftwoitems)
#second program
a=[5,6,8]
print("length of list : ",len(a))
a.append(6)
print("adding new value in list : ",a)
print("maixmum in list : ",max(a))
print("minimum in list :",min(a))
a.index(6)
print(a)
#third program of list related to random module
import random
a=list(range(1,16))
print(a)
random.shuffle(a)
print(a)
random.choice(a)
#program to tuple
#note tuple can not be changed it is immutable
a=(4,5,8,9,'new','items')
b=(10,8,7,2,'last','thing')
print(a)
#fisrt program of dictionaries
a={'name':'aman','age':89,'class':10}
print(a)
print(list(a.keys()))
print(list(a.values()))
#second program of dictionaries
n={}
n["name"]="aman"
n["profession"]="teacher"
print(n)