We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bf1a7a1 commit 9246373Copy full SHA for 9246373
q2/inu/q1.py
@@ -0,0 +1,14 @@
1
+# for q1
2
+member = {}
3
+
4
+for line in open('../data.txt', 'r'):
5
+ name, height, weight = line.split(',')
6
+ member[name] = { "height": float(height), "weight": float(weight) }
7
8
+def bmi_calculator(name, member_list):
9
+ if name in member_list:
10
+ person = member_list[name]
11
+ weight, height = person["weight"], person["height"]
12
+ return weight / ((height/100)**2)
13
+ else:
14
+ return "Invalid name"
0 commit comments