-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPython_Notes_2
More file actions
41 lines (29 loc) · 911 Bytes
/
Python_Notes_2
File metadata and controls
41 lines (29 loc) · 911 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
Day-02
python --version -- check python version
python3 -m venv day2 -- to create virtual env for specific project
source day2/bin/activate -- to activate virtual env (day2)
deactivate -- to deactivate the virtual env
* Data Structure *
list [ can use different data types ] -- list
dict
set
tuple
list -->
a = [...,...,...,...,...] -- can create list
a.append(....) -- append the value of variable in list
cloud = list()
a.remove(..) -- remove specific item from list
len(cloud) -- length of list
cloud[2] -- select that position list value, here is 2
print(dir(cloud)) -- just like man in linux
print(cloud.append.__doc__) -- explain what append can do..
Dict -->
we can defind key - value pair in dictionary inside {}
exp :
info ={
...... ,
}
set -->
info = {1,55,"yadav"} -- example of set
days = set() -- empty set
set -- Duplicate value gets ignored in output