-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpython3_lesson_1.py
More file actions
74 lines (74 loc) · 1.03 KB
/
python3_lesson_1.py
File metadata and controls
74 lines (74 loc) · 1.03 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
>>> vergi = 29/100
>>> satis = 189
>>> vergi * satis
54.809999999999995
>>> satis + _
243.81
>>> #' _' en son cikan toplam sonucu, satisa ekler.
...
>>> round(_,2)
243.81
>>> vergi * satis
54.809999999999995
>>> round(_,2)
54.81
>>> round(_,1)
54.8
>>> round(34/98,3)
0.347
>>> round(34/98,2)
0.35
>>> "python v3"
'python v3'
>>> x = 'python v3 '
>>> x
'python v3 '
>>> print(x)
python v3
>>> y = 'python \n v3'
>>> y
'python \n v3'
>>> print(y)
python
v3
>>> y = ' code \'gar python'
>>> y
" code 'gar python"
>>> y = "code\\gar python"
>>> y
'code\\gar python'
>>> print(y)
code\gar python
>>> x + y
File "<stdin>", line 1
x + y
^
IndentationError: unexpected indent
>>> x+y
'python v3 code\\gar python'
>>> 4*x
'python v3 python v3 python v3 python v3 '
>>> 3*x+y
'python v3 python v3 python v3 code\\gar python'
>>> x[2]
't'
>>> x[-2]
'3'
>>> x
'python v3 '
>>> x[2:7]
'thon '
>>> x[2:-2]
'thon v'
>>> x[2:-]
File "<stdin>", line 1
x[2:-]
^
SyntaxError: invalid syntax
>>> x[2:]
'thon v3 '
>>> x[:2]
'py'
>>> len(x)
10
>>>