Problem 167762 · easy · Level 01 Prerequisites & Setup

Quiz Percentage

functions · percentages · f-strings · rounding

Write percent_score(correct, total) that returns a quiz score as a string with one decimal place followed by %, for example "85.0%".

Examples

Input:  correct = 17, total = 20
Output: "85.0%"
Input:  correct = 1, total = 3
Output: "33.3%"

Constraints

  • 0 <= correct <= total, 1 <= total <= 10**6

Goals

  • Turn a fraction into a percentage
  • Return a formatted string ending in a percent sign
Starting Python…