-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlets_start.py
More file actions
127 lines (109 loc) · 1.44 KB
/
lets_start.py
File metadata and controls
127 lines (109 loc) · 1.44 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# Commenting
a=1 #comment
#comment is just use for code readability
name="#isko comment mat samagh lena"
print(name)
#basic operators
a=2+2
print(a)
print(2+3)
print(40-4*2)
#grouping
a=(40-4)/5
print(a)
print(type(a))
#floor division
print(17/3)
print(17//3)
print(17%3)
print(5*3+2)
print(4**2)
w=5*4
y=10
x=w+y
print(x)
tax = 12.5 / 100
price = 100.50
print(price * tax)
x=round(price * tax, 2)
print(x)
#relationalops
print(10>20)
print(2<1)
print(20<=20)
print(20>=20)
print(20<=19)
print(20<=21)
print(20==20)
print(20==19)
print(20!=19)
print(20!=20)
#assignment operators
a=10
print(a)
a+=10
print(a)
a-=5
print(a)
a*=5
print(a)
a**=2
print(a)
a//=7
print(a)
a%=5
print(a)
a/=10
print(a)
a=10
b=5
a+=b
print(a)
#logical-ops
a=5>4 and 3>2
print (a)
b=5>4 or 3<2
print (b)
c=not(5>4)
print (c)
#Strings
print('Hello')
print("Hello Python")
print('doesn\'t')
print("doesn't")
print('Oh . "My God"')
print("Oh . \"My God\"")
print('I couldn\'t do that, can you?')
#concatination
word='hello' 'python'
print(word)
#word 'again'
a=word+'again'
print(a)
#repeat
a='Hello'
b=a*2
print(b)
c=b+"world"
print(c)
print('hello'*2+"python")
#indexing
word="Hello Python"
print(word[0])
print(word[1])
print(word[6])
#print(word[12])
print(word[-1])
print(word[-2])
print(word[-6])
print(word[-12])
#print(word[-13])
#slicing
#error-slicing
#print(word[30])
print(word[2:30])
print("---"+word[30:])
#IMMUTABLE
#word[3]="H"
a="Hi"+word[5:]
print(a)