Output matches the expectation but still gets error- C1M1_Assignment

Hi Team,

I get expected output, still see the error.

Pls assist. Sharing the screenshot.

Hi @anujmmm , welcome! I think you are seeing this error because the expected output doesn’t have a line break between the two sentences, while your f-string does. The exercise is asking for a multi-line f-string in the sense that the opening and closing triple quotes are on separate lines, like in Exercise 2, while the text is on one line. Also, in future, please do not share code on the forum as this is against the forum guidelines. You should share the error message you are getting. If necessary, a mentor will ask you to send your code to them in a direct message. I hope this helps!

2 Likes

Hi @anujmmm,

To build on what Boryana correctly mentioned above, in the world of programming, developing an eye for precision is an important skill.

I noticed two subtle differences that are causing the mismatch:

  1. Line Breaks: (As pointed by Boryana) The expected output is a single line, whereas yours is split across two.
  2. Punctuation: Your output is missing the final period (.). Take a look at the end of second sentence from the expected output.

While these might look like trivial formatting preferences, learning to get these tiny details right is actually very important. In a real-world system, a very small deviation can trigger a massive chain reaction.

For example, consider a bank balance. If an account holds: 2550.00

But due to a small formatting slip, it is processed/displayed as: 25.5000

While the digits are exactly the same, the result is completely different!

The goal here isn’t just to satisfy the grader, but to train yourself to spot these minute details, because, as you can see with the bank example, they can have huge effects. Fix those two formatting points and it should work perfectly!

Best,
Mubsi

2 Likes