• API
• FAQ
• Tools
• Archive
daily pastebin goal
51%
SHARE
TWEET

# newfile.py

a guest May 17th, 2018 332 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1. print("sky ,here")
2. #now we r  direct to function
3. name1 = "Reena singh"
4. weight_kg1 = 40
5. height_m1= 1.4
6.
7. name2 = "Preeti"
8. weight_kg2 = 68
9. height_m2 = 1.8
10.
11. name3 = "nikki"
12. weight_kg3 = 59
13. height_m3 = 1.5
14.
15. name4 = "sky"
16. weight_kg4 = 48
17. height_m4 = 1.9
18.
19. name5 = "shiv shankar singh"
20. weight_kg5 = 90
21. height_m5 = 1.89
22.
23.
24.
25. def BMI(name, weight_kg, height_m):
26.        BMI = weight_kg / (height_m * height_m)
27.        print("BMI ; ")
28.        print(BMI)
29.        if BMI > 25 :
30.            return name + (" is overweight")
31.        elif 18 < BMI < 25:
32.            return name + (" is neither underweight nor overweight")
33.        else :
34.            return name + (" is underweight")
35.
36. result1 = BMI(name1, weight_kg1, height_m1)
37. result2 = BMI(name2, weight_kg2, height_m2)
38. result3 = BMI(name3, weight_kg3, height_m3)
39. result4 = BMI(name4, weight_kg4, height_m4)
40. result5 = BMI(name5, weight_kg5, height_m5)
41. print(result1)
42. print(result2)
43. print(result3)
44. print(result4)
45. print(result5)
46. #now wat about creating everythingh again do watever you wanna do maen
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.         #now lets create list or arrays
57.
58.
59.
60.
61.
62.
63. a = [ 1, 2, 3, 4, 5]
64. print(a)
65.
66. a.append(6)
67. print(a)
68.
69. a.append([9, 8, 7, 6, 5, 4])
70. print(a)
71. a.append('rorito')
72. print(a)
73.
74. a.pop()
75. print(a)
76.
77.
78.
79.
80.
81.
82.
83.
84. b = ["microsoft", "mojang", "apple"]
85. print(b)
86.
87.
88. #now replace some cntents
89.
90. temp = b[0]
91. b[0] = b[2]
92. b[2] = temp
93.
94.
95. print(b)
96.
97.
98.
99.
100.
101. #now its time to use for loopso lets do it
102.
103. c = ["minecraft", "donut", "banana"]
104. for items in c:
105.        print(items)
106.
107.
108. #now just make another list with range function
109. print(4 % 3)
110.
111. f = list(range(1, 9))
112. print(f)
113. total = 0
114. for n in range(1, 9):
115.        if n % 3 == 0:
116.            total += n
117. print(total)
118.
119. m = list(range(1, 100))
120. print(m)
121. total2 = 0
122. for num in m:
123.        if num % 3 == 0:
124.               total2 += num
125. print(total2)
126. total3 = 0
127. for num in m:
128.        if num % 5 == 0:
129.            total3 += num
130. print(total3)
131. total4 = 0
132. for num in m:
133.        if num % 7 == 0:
134.            total4 = total4 + num
135.
136. print(total4)
137. total5 = 0
138. for num in m:
139.        if num % 9:
140.               total5 += num
141. print(total5)
142.
143. h = list(range(1, 1000))
144. print(h)
145. total6 = 0
146. for element in h:
147.        if element % 3:
148.            total6 += element
149. print(total6)
150.
151. def call(x) :
152.        print(x)
153.        print("weeeee")
154.
155. call(7)
157. total7 = 0
158. i = 1
159. while i < 5:
160.        total7 += i
161.        i += 1
162. print(total7)
163. #so like this we are going to use it till no. 4
164. total8 = 0
165. j = 2
166. while j < 5:
167.        total8 += j
168.        j +=1
169. print(total8)
170. total9 = 0
171. k = 3
172. while k < 5:
173.        total9 += k
174.        k += 1
175. print(total9)
176.
177. #now we are going to a while loop test and len test
178.
179. desire  = [5, 5, 4, 3, 2, 1, -1, -2, -3, -4, -5, -5]
180. print(desire)
181.
182. total10 = 0
183. l = 0
184. while desire[l] > 0:
185.        total10 += desire[l]
186.        l += 1
187. print(total10)
188.
189.
190.
191. desire  = [5, 5, 4, 3, 2, 1]
192. total11 = 0
193. m = 0
194. while m < len(desire) and desire[m] > 0:
195.        total11 += desire[m]
196.        m += 1
197. print(total11)
198.
199.
200. list = [6, 5, 4, 3, 2, 1]
201. total12 = 0
202. n = 0
203. while n < len(list) and list[n] > 0:
204.        total12 += list[n]
205.        n += 1
206. print(total12)
207. #think that it is done
208.
209. list2 = [7, 6, 5, 4, 2, 1, 1, -1, -2, -3, -4]
210. total13 = 0
211. for each in list2:
212.        if each <= 0:
213.            break
214.        total13 += each
215. print(total13)
216.  #now to do breah\k loop with while loop
217. total14 = 0
218. o = 0
219. while True:
220.        total14 += list2[o]
221.        o += 1
222.        if list2[o] <= 0:
223.            break
224. print(total14)
225.
226. #now do it with negetive inteager
227.
228. list3 = ["apple", "dog", "dove"]
229. print(list3)
230. for index in range(len(list3)):
231.        for p in range(index + 1):
232.            print(list3[index])
233.
234.
235. list4 = ["banana", "worm", "dominant", "antman"]
236. for q in range(len(list4)):
237.        for r in range(q + 1):
238.            print(list4[q])
239.
240. list5 = [7, 6, 5, 4, 3, 1, -1, -2, -3, -4, -5]
241. total15 = 0
242. s = len(list5) - 1
243. while list5[s] > 0:
244.        total15 += list5[s]
245.        s -= 1
246. print(total15)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.

Top