Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- degrees = list()
- for i in range(0, 11):
- d = int(input("Number of students that wrote " + str(i) + ": "))
- degrees.append(d)
- N = 0
- for i in range(len(degrees)):
- N += degrees[i]
- sum = 0
- for i in range(len(degrees)):
- sum += i * degrees[i]
- average = sum / N
- sum2 = 0
- N2 = 0
- for i in range(5, len(degrees)):
- N2 += degrees[i]
- for i in range(5, len(degrees)):
- sum2 += i * degrees[i]
- average2 = sum2 / N2
- print()
- print("Students: " + str(N))
- passed = N2 /N
- passed = round(100 * passed, 2) / 100
- print("Passed: " + str(100 * passed) + "%")
- print("Average = " + str(average))
- print("Average of the students that passed: " + str(average2))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement