You are viewing a single comment's thread. Return to all comments →
student = int(input()) i = 0 dic = {} while student > i: name = input().split() name1 = name[0] marks1 = float(name[1]) marks2 = float(name[2]) marks3 = float(name[3]) percent = format(((marks1 + marks2 + marks3) / 3),'.2f') dic[name1] = percent i += 1 query = input() print(dic[query])
simple code for beginner
Seems like cookies are disabled on this browser, please enable them to open this website
Finding the percentage
You are viewing a single comment's thread. Return to all comments →
student = int(input()) i = 0 dic = {} while student > i: name = input().split() name1 = name[0] marks1 = float(name[1]) marks2 = float(name[2]) marks3 = float(name[3]) percent = format(((marks1 + marks2 + marks3) / 3),'.2f') dic[name1] = percent i += 1 query = input() print(dic[query])
simple code for beginner