runtime
48 / 500
question 48 Loops & Iteration · medium

A rating bar for any scale

This program draws a film's rating as stars and dots, but only for a 5-star scale: a separate branch for every rating. The app is moving to a 10-star scale. Rewrite it with a loop so the bar has max_stars places, * for each star earned and . for the rest. For a 5-star scale it must print exactly what it prints now.

First linesrating = 3 and max_stars = 5. Check runs your program again with other ratings and scales
PrintsRating: ***..
Expected output1 line
  1. 1Rating: ***..

Loading your progress…

A rating bar for any scale — Python practice · Runtime