+ 1

Where did mess up....

I'm not getting what it wants me to do.. # Asks the user to enter the savings savings = input("Enter your savings:") # Convert the user input into a float value and update the variable savings = float(input("Enter your 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) Pls help..

2nd Aug 2025, 7:35 PM
Lucky Zxy
Lucky Zxy - avatar
4 Respuestas
+ 2
In the second line of code, you need to write savings=float(savings) instead of savings=float(input()).
2nd Aug 2025, 7:43 PM
Mila
Mila - avatar
+ 5
Did the task come with the text "enter your savings", or did you add that? Look closely at your 2nd line of coding (ignoring comments). Do you need input 2x? *hint: maybe that's the line to change
2nd Aug 2025, 7:40 PM
Ausgrindtube
Ausgrindtube - avatar
+ 2
Thanks.. I was writing it 2 times.. This is the correct code according to the question # 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)
2nd Aug 2025, 8:03 PM
Lucky Zxy
Lucky Zxy - avatar
0
# Ask the user to enter savings (only once) and convert to float savings = float(input("Enter your savings: ")) # Calculate balance after 1 year with 5% interest balance = savings * 1.05 # Round to 2 decimal places (if needed for currency) balance = round(balance, 2) # Convert to string for concatenation balance_str = str(balance) # Construct and print the message message = "Amount in 1 year: " + balance_str print(message)
3rd Aug 2025, 7:14 AM
𝐀𝐲𝐞𝐬𝐡𝐚 𝐍𝐨𝐨𝐫
𝐀𝐲𝐞𝐬𝐡𝐚 𝐍𝐨𝐨𝐫 - avatar