We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3b5316b commit 86851f4Copy full SHA for 86851f4
191/bmi.py
@@ -28,14 +28,11 @@
28
def person_max_bmi(data=data):
29
"""Return (name, BMI float) of the character in data that
30
has the highest BMI (rounded on 2 decimals)"""
31
- BMIdict = dict()
+ BMIs = dict()
32
for line in data.splitlines():
33
line = dedent(line)
34
- entry=line.split(',')
35
- name = entry[0]
36
- height = entry[1]
37
- mass = entry[2]
+ name, height, mass = line.split(',')
38
BMI = float(mass) / ((int(height) / 100) ** 2)
39
- BMIdict.update({name:round(BMI,ndigits=2)})
40
- sortedbmilist = sorted(BMIdict.items(),key= lambda x: x[1])
41
- return sortedbmilist[-1]
+ BMIs.update({name:round(BMI,ndigits=2)})
+ sortedbmis = sorted(BMIs.items(),key= lambda x: x[1])
+ return sortedbmis[-1]
0 commit comments