+ 1
I.need help first timer
Variables to output how would u do this ...my car is broken I need a new car. but I only have 1000 in my saving I need to borrow 4000 from the bank, because I need 5000 in total in my savings for that
8 ответов
+ 2
thank you
+ 2
This will input your savings/loan amounts as input from the user, then it'll calculate the total before printing the information to you.
https://code.sololearn.com/cd67cL6XpGOg/#py
savings = int(input("How much do you have in savings?"))
loan = int(input("How much do you want from a loan?"))
total = savings + loan
print("Amount in savings: ", savings)
print("Loan Amount: ", loan)
print("Total Car Cost: ", total)
+ 1
savings = 1000
loan = 4000
total = savings + loan
print(total)
+ 1
how would input it like a sentence
+ 1
thank u so much
- 1
What would you like to do with the variable after you are done? And is this a program to help people with things like that or just a game or such?
- 1
Well just use the above example and then if you want to change it simply use the saving += 100 or -100 for a loss.
- 1
If you want to use it in a sentence: print(‘You have this much in savings: ‘, savings)