+ 1

I am stalked on the Finance App, I could not move forward, for the past two weeks.

I got the first test case with input of 150 but the 2nd and 3rd cases were wrong,

5th Jun 2023, 9:44 PM
Oluremi Okuboyejo
Oluremi Okuboyejo - avatar
10 Answers
+ 5
Oluremi Okuboyejo Plus, add a description of the task. Both in the question description - use "+" button. So it doesn't get lost among answers.
5th Jun 2023, 11:33 PM
Emerson Prado
Emerson Prado - avatar
+ 4
This is the correct code # Asks the user to enter the savings savings = input() # Convert the user input into a float value and update the variable savings = float(savings) # Savings grow after 1 year at a 5% annual interest rate balance = savings * 1.05 # Convert the balance into a string and update the variable balance = str(balance) # Concatenate the 2 strings to produce a message message = "Amount in 1 year: " + balance # Display the message print(message)
9th Sep 2023, 8:46 PM
Joshua
Joshua - avatar
+ 3
Oluremi Okuboyejo Pls follow the instructions people gave about including the task description and a link to your code in Code Playground in the question description. It does help. That said: "savings = 150.0" does not convert user input - it fixes the value in 150. Rethink this. "print(balance)" does not change the variable. BTW, using formatted output makes it unecessary to convert the variable first.
6th Jun 2023, 10:17 AM
Emerson Prado
Emerson Prado - avatar
+ 2
Gonna need way more info to help. Save your code from the problem as a code bit, make it public, and share a link here.
5th Jun 2023, 10:07 PM
Orin Cook
Orin Cook - avatar
+ 1
Share your code here
6th Jun 2023, 6:51 AM
Hasnain [ACTIVE CHALLENGER]
Hasnain [ACTIVE CHALLENGER] - avatar
+ 1
# Asks the user to enter the savings savings = input() # Convert the user input into a float value and update the variable savings = 150.0 # Savings grow after 1 year at a 5% annual interest rate balance = savings * 1.05 # Convert the balance into a string and update the variable print(balance) # Concatenate the 2 strings to produce a message message = "Amount in 1 year: " + balance # Display the message print(balance)
6th Jun 2023, 9:05 AM
Oluremi Okuboyejo
Oluremi Okuboyejo - avatar
+ 1
Ok yeah, that's never gonna work because you're not actually taking user input, as Emerson Prado said, and then you're also not doing your calculations based on that input. The only literal numbers in your code should be the interest rate, everything else should be variables. Also pro tip: use "balance + balance*0.05" instead of "balance*1.05", for stupid rounding reasons edit: hang on you're not OP lol, what kinda shenanigans is this
6th Jun 2023, 11:54 AM
Orin Cook
Orin Cook - avatar
0
Please share the code link here. Follow Orin Cook's procedures.
5th Jun 2023, 10:59 PM
Danish Zubair
Danish Zubair - avatar
6th Jun 2023, 10:47 AM
Yass Az
0
is that even in Sololearn ? I can't find that lesson...
6th Jun 2023, 3:15 PM
Bob_Li
Bob_Li - avatar