Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5
In the provided code, there are a few issues and missing parts. Here's an overview of the problems: Line 2: The input() function is not properly used. The input prompt is missing, and there's a typo in the Russian characters (ру) instead of input(). Line 5: The line where savings is set to 150.00 seems to be hardcoded instead of taking user input. Line 8: The calculation of the balance is incorrect. Adding 5% to the savings won't yield the desired result. Instead, you should calculate the interest using the savings and interest rate. Line 11: The str() conversion is unnecessary because balance is already a string on line 9. Line 14: The sum variable is unnecessary, as you're not using it in the code. Line 17: The print() statement is missing the variable name (balance) to display the calculated balance.
6th Jun 2023, 5:02 AM
Jared
Jared - avatar
+ 1
michael anderson You have the same code as in this question below. Did someone copy? https://www.sololearn.com/discuss/3219008/?ref=app
6th Jun 2023, 1:23 PM
Emerson Prado
Emerson Prado - avatar
+ 1
michael anderson Pls help others to help you. Edit your question description and add a description of the task and your difficulties. Plus, it's way better to add a link to your code in Code Playground - where people can test it - then to copy/paste the code - where you can get copy errors. Pls explain how don't you know where "py" came from. Didn't you write the code? Finally, follow Jared Ramon Elizan 's hints. They'll get you quite close.
6th Jun 2023, 1:37 PM
Emerson Prado
Emerson Prado - avatar
+ 1
michael anderson Well, the copied code is horribly written. My recommendation: read the suggestions people gave you, open Code Playground, write your own code, save as public, run it, and include THE LINK and the error code IN THE QUESTION DESCRIPTION. Let's stop wasting time on the wrong code you didn't write.
6th Jun 2023, 5:06 PM
Emerson Prado
Emerson Prado - avatar