Help please! Data conversation lesso | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
0

Help please! Data conversation lesso

Please help, I'm on the final practice of the data conversation unit. Please tell me where I'm going wrong? It will either say I'm missing perenthesis, or it will put 150 before the message. # Asks the user to enter the savings saving = input(150) # Convert the user input into a float value and update the variable savings = float(saving) # 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)

15th May 2023, 7:55 AM
Steph Smith
Steph Smith - avatar
2 ответов
+ 7
The problem is that you entered 150 in the input function So if you enter: 5 The output will be: 1505 The amount… ^^^ Incorrect The number as argument in the input function is like printing that number before you enter input. So the result is wrong Remove 150 from input() function.
15th May 2023, 8:38 AM
Ugulberto Sánchez
Ugulberto Sánchez - avatar
+ 1
Thank you very much for your help, silly mistake on my part 😊
16th May 2023, 9:29 AM
Steph Smith
Steph Smith - avatar