← Back to Dictionaries
Question 295
Pass And Fail Tally
Pass And Fail Tally
The dict marks maps each student to a mark. Count how many passed (a mark of 50 or more) and how many failed, keeping both counts in the dict tally that starts with pass and fail at 0, then loop over tally and print each key with its count in the form <key>: <count>. Input: none. Output: two lines, pass first then fail.
Expected Output:
pass: 3 fail: 2
= newline. The output ends with a newline — print one after the last line.
Hints3 available
Sign in to use hintsTopics:
Dictionaries
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Ctrl+Space to expand shortcuts (pr, inp, def)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.