Class Marks Report
Programs with input · Advanced · about 18 min
Read a student's name, then their marks (a whole number) on the next line, again and again. When the name typed is done, stop reading. Then print:
- one line per student, in the order they were typed, as
Aarav: 78 (Pass), where 40 or more is a Pass and below 40 is a Fail - the class average with 2 decimal places, as
Class average: 65.50 - the highest scorer as
Topper: Priya with 92(if two tie, the one typed first)
If done is the first thing typed, print No students entered instead.
The prompts inside input() are not checked, only what you print.
Example
You type:
Aarav 78 Priya 92 Tom 35 Sara 57 done
The program prints:
Aarav: 78 (Pass) Priya: 92 (Pass) Tom: 35 (Fail) Sara: 57 (Pass) Class average: 65.50 Topper: Priya with 92
name = input("Name (done to stop): ")
# Keep reading names and marks until done, then print the report
The solution opens after your first Check.