+ 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,
10 ответов
+ 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.
+ 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)
+ 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.
+ 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.
+ 1
Share your code here
+ 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)
+ 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
0
Please share the code link here. Follow Orin Cook's procedures.
0
https://code.sololearn.com/cERSRnd8c5KV/?ref=app
Emerson Prado
Here is the code in playground
0
is that even in Sololearn ? I can't find that lesson...