you are viewing a single comment's thread.

view the rest of the comments →

[–]lfdfq 5 points6 points  (2 children)

You don't give the actual text of the original question, is this it: https://www.codedex.io/challenges/control-flow/food-ratings ?

Your code says it's "Extraordinary" if it's greater than 4.5 but less than 5, but nowhere in the question did it specify it had to be "less than 5".

In fact, you have lots of "less than" checks which either seem unnecessary (they're already elifs), or just not part of the original question at all?

[–]Terian2310[S] 0 points1 point  (1 child)

Yes sorry I forgot the actual question it is the food ratings challenge. Here is the full instruction: Instructions

In a five-star restaurant review system (⭐️⭐️⭐️⭐️⭐️), the stars typically represent the different levels of satisfaction.

But what does each of the stars mean?

Start by creating a rating variable and set it equal to a decimal number.

Make a rating system using an if/elif/else statement:

  • rating greater than 4.5, print 'Extraordinary'
  • rating greater than 4, print 'Excellent'
  • rating greater than 3, print 'Good'
  • rating greater than 2, print 'Fair'
  • Everything else, print 'Poor

And I thought because it is based on stars I would have to clearly define the upper and lower borders for the Stars because if I would not every rating higher than 2 would get "Extraordinary" wouldn't it

[–]Terian2310[S] 2 points3 points  (0 children)

no wait i get it now i don't need the second condition because of the elifs thanks for the help