-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodule_2_prerecoded.py
195 lines (150 loc) · 3.38 KB
/
module_2_prerecoded.py
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
"""
# descriptive name
# lower case with undersore
# start with leter or underscore
# No special character
#Case Sensetive
# short but miningful
# use singular noun
#contintancy
# avoid __
"""
# data type
# numeric data type
#String Data type
# Sequence Data Type
# numeric data type
"""age=34
print(age)
marks=85.5
print(type(marks))"""
#String Data type
"""
name="Rabbil Hasan"
print(name)"""
# List data type
# Contain Mixed type data
# Contain Duplicate Value
# Maintain Order , index start with 0
# Mutable data type
"""
city=["Dhaka","Rangpur","Khulna", 333, 3.25,True,"Dhaka"]
letter=["A","B","C", "D","E","F","G","H"]
print(letter[5])"""
# Tuple data type
#Contain Mixed type data
#Contain Duplicate Value
# Maintain Order , index start with 0
# Immutable data type
#city=("Dfhaka","Rangpur","Khulna")
#number=("A","B","C", "D","E","F","G","H")
#number1=("A","B","C", "A","E","S","G",20.2)
#print(number1)
# range data type
#numbers=range(1,10)
#numbers1=range(0,10,2)
#print(*numbers1)
# Boolean Data Type
#type=False
#print(type)
# None Data type
#taka=None
#print(taka)
# Mapping Data type Dictonary
"""persons= {
'name':'Ashraful Islam',
'age': "40",
'district':"Tangail",
'is_bangladeshi': True
}
print(persons['name'])"""
# Set
# mutable
# unorder
# avoid duplicate value
"""number={1,2,3,2,3,2,2}
print(number)
# Frogen Set
# immutable
# unorder
# avoid duplicate value
unic_number=({1,2,3,4,3,2,4})
print(unic_number)"""
# String indexing
text="#Hello World "
"""
print(text)
print(text[0])"""
# strting slicing start
#print(text[0:5])
# strting slicing end
#print(text[6:])
# Step slicing
#print(text[6::2])
# String repetation
repetation=text *5
#print(repetation)
# string concatanation
"""string1="Hello"
string2="World"
#combine=string1+ ", "+ string2
combine=",".join([string1,string2])
print(combine)"""
text="Hello World"
"""print("Uppercase ",text.upper())
print("Lowercase ",text.lower())
print("Capitalized ",text.capitalize())
print("Title ",text.title())
print("Swap ",text.swapcase())
print("Replace ",text.replace("World", "Python"))
print("Split", text.split(" "))"""
"""word=["Hello", "world"]
print("Text Join", " ,".join(word))
text1=" Hello World "
print(text1.strip())
print(text1.lstrip())
print(text1.rstrip())
print(text.startswith("Hello"))
print(text.endswith("Hello"))
print(text.endswith("World"))
print("Find ", text.find("World"))"""
#Number
"""
a=10
b=3
c=5.14
d=4
print("Addition", a+b)
print("Subtraction", a-b)
print("Multiplication", a*b)
print("Division", a/b)
print("Integer Division", a//b)
print("Power 10x10x10", a**b)
print("Modulus ", a%b)
"""
#Type Conversion
"""a=10
b=4.84
print("Convert Int to Float", float(a))
print("Convert Float to Int", int(b))
print("Convert Int to Complex", complex(b))"""
"""import math
print("Print Sqire toot", math.sqrt(100))
print("Print Power", math.pow(10,3))
print('Sin 90 degree= ', math.sin(math.radians(90)))
print('Cos 90 degree= ', math.cos(math.radians(0)))
print("natural log of 10", math.log(10))
print("natural log of 10", math.log10(10))
print("Exponential", math.exp(100))
print("GCD 5,45 is ", math.gcd(5,45))
print("LCM 5,45 is", math.lcm(5,45))
print("Absolute Value of -7.154", math.fabs(+7.154))
print("Floor", math.floor(3.7))
print("Ceiling", math.floor(3.7))
print("PI", math.pi)
print("Elears", math.e)"""
for i in range(3):
print(i)
x=11
y=3
print(x%y)