File tree Expand file tree Collapse file tree 3 files changed +56
-0
lines changed
Expand file tree Collapse file tree 3 files changed +56
-0
lines changed Original file line number Diff line number Diff line change 1+ # single comment
2+
3+
4+ """
5+ Multiline comments do not actualy exist in Python
6+ Sometimes you can meet creating of multiline comments by using tripple quotes,
7+ but that is not a comments in general.
8+ Tripple quotes in python treats as regular string and
9+ if it is not assigned to any variable it will be immediately garbage collected
10+ as soon as that code executes. So it doesn't affect execution.
11+ """
Original file line number Diff line number Diff line change 1+ #print(a)
2+ #NameError: name 'a' is not defined
3+
4+ a = 5
5+ print (a )
6+ type (a )
7+ #<class 'int'>
8+
9+ b = 5.2
10+
11+ dic = {'d' : a , 'c' : b }
12+ #obj
13+ print ("Dictionary is: " , dic )
14+
15+ dic ['c' ] = 10
16+ print ("Dictionary has been changed: " , dic )
Original file line number Diff line number Diff line change 1+ a = 5
2+ print (type (a ))
3+
4+ b = 5.2
5+ print (type (b ))
6+ #<class 'float'>
7+
8+ print (type (True ))
9+ #<class 'bool'>
10+
11+ print (type (2 + 3j ))
12+ #<class 'complex'>
13+
14+ print (type ('hello' ))
15+ #<class 'str'>
16+
17+
18+ person = {
19+ 'name' : 'Rikardo' ,
20+ 'age' : 27 ,
21+ 'profession' : 'actor'
22+ }
23+
24+ person ['age' ] = 28
25+ print (person )
26+
27+ array = {a , b , '56' }
28+ print ('Arrray ' , array )
29+ print (type (array ))
You can’t perform that action at this time.
0 commit comments