Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("sky ,here")
- #now we r direct to function
- name1 = "Reena singh"
- weight_kg1 = 40
- height_m1= 1.4
- name2 = "Preeti"
- weight_kg2 = 68
- height_m2 = 1.8
- name3 = "nikki"
- weight_kg3 = 59
- height_m3 = 1.5
- name4 = "sky"
- weight_kg4 = 48
- height_m4 = 1.9
- name5 = "shiv shankar singh"
- weight_kg5 = 90
- height_m5 = 1.89
- def BMI(name, weight_kg, height_m):
- BMI = weight_kg / (height_m * height_m)
- print("BMI ; ")
- print(BMI)
- if BMI > 25 :
- return name + (" is overweight")
- elif 18 < BMI < 25:
- return name + (" is neither underweight nor overweight")
- else :
- return name + (" is underweight")
- result1 = BMI(name1, weight_kg1, height_m1)
- result2 = BMI(name2, weight_kg2, height_m2)
- result3 = BMI(name3, weight_kg3, height_m3)
- result4 = BMI(name4, weight_kg4, height_m4)
- result5 = BMI(name5, weight_kg5, height_m5)
- print(result1)
- print(result2)
- print(result3)
- print(result4)
- print(result5)
- #now wat about creating everythingh again do watever you wanna do maen
- #now lets create list or arrays
- a = [ 1, 2, 3, 4, 5]
- print(a)
- a.append(6)
- print(a)
- a.append([9, 8, 7, 6, 5, 4])
- print(a)
- a.append('rorito')
- print(a)
- a.pop()
- print(a)
- b = ["microsoft", "mojang", "apple"]
- print(b)
- #now replace some cntents
- temp = b[0]
- b[0] = b[2]
- b[2] = temp
- print(b)
- #now its time to use for loopso lets do it
- c = ["minecraft", "donut", "banana"]
- for items in c:
- print(items)
- #now just make another list with range function
- print(4 % 3)
- f = list(range(1, 9))
- print(f)
- total = 0
- for n in range(1, 9):
- if n % 3 == 0:
- total += n
- print(total)
- m = list(range(1, 100))
- print(m)
- total2 = 0
- for num in m:
- if num % 3 == 0:
- total2 += num
- print(total2)
- total3 = 0
- for num in m:
- if num % 5 == 0:
- total3 += num
- print(total3)
- total4 = 0
- for num in m:
- if num % 7 == 0:
- total4 = total4 + num
- print(total4)
- total5 = 0
- for num in m:
- if num % 9:
- total5 += num
- print(total5)
- h = list(range(1, 1000))
- print(h)
- total6 = 0
- for element in h:
- if element % 3:
- total6 += element
- print(total6)
- def call(x) :
- print(x)
- print("weeeee")
- call(7)
- #now lets start with while loop
- total7 = 0
- i = 1
- while i < 5:
- total7 += i
- i += 1
- print(total7)
- #so like this we are going to use it till no. 4
- total8 = 0
- j = 2
- while j < 5:
- total8 += j
- j +=1
- print(total8)
- total9 = 0
- k = 3
- while k < 5:
- total9 += k
- k += 1
- print(total9)
- #now we are going to a while loop test and len test
- desire = [5, 5, 4, 3, 2, 1, -1, -2, -3, -4, -5, -5]
- print(desire)
- total10 = 0
- l = 0
- while desire[l] > 0:
- total10 += desire[l]
- l += 1
- print(total10)
- desire = [5, 5, 4, 3, 2, 1]
- total11 = 0
- m = 0
- while m < len(desire) and desire[m] > 0:
- total11 += desire[m]
- m += 1
- print(total11)
- list = [6, 5, 4, 3, 2, 1]
- total12 = 0
- n = 0
- while n < len(list) and list[n] > 0:
- total12 += list[n]
- n += 1
- print(total12)
- #think that it is done
- list2 = [7, 6, 5, 4, 2, 1, 1, -1, -2, -3, -4]
- total13 = 0
- for each in list2:
- if each <= 0:
- break
- total13 += each
- print(total13)
- #now to do breah\k loop with while loop
- total14 = 0
- o = 0
- while True:
- total14 += list2[o]
- o += 1
- if list2[o] <= 0:
- break
- print(total14)
- #now do it with negetive inteager
- list3 = ["apple", "dog", "dove"]
- print(list3)
- for index in range(len(list3)):
- for p in range(index + 1):
- print(list3[index])
- list4 = ["banana", "worm", "dominant", "antman"]
- for q in range(len(list4)):
- for r in range(q + 1):
- print(list4[q])
- list5 = [7, 6, 5, 4, 3, 1, -1, -2, -3, -4, -5]
- total15 = 0
- s = len(list5) - 1
- while list5[s] > 0:
- total15 += list5[s]
- s -= 1
- print(total15)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement