Advertisement
banovski

Batch BMI Calculator

Nov 10th, 2021
967
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.37 KB | None | 0 0
  1. #! /usr/bin/env python3
  2.  
  3. # Решение №1
  4. def calcBmi1(l): return (list(map((lambda y : y[0] / y[1] ** 2), l)))
  5.  
  6. # Решение №2
  7. def calcBmi2(l): return [y[0] / y[1] ** 2 for y in l]
  8.  
  9. # Решение №3
  10. o = list()
  11. def calcBmi3(l):
  12.     for i in l:
  13.         o.append(i[0] / i[1] ** 2)
  14.     return o
  15.  
  16. # print(calcBmi([(70, 1.7), (80, 1.8), (90, 1.9)]))
  17.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement