I.need help first timer | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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

7th Feb 2018, 7:41 PM
Phil Rinaldi
Phil Rinaldi - avatar
8 Answers
+ 2
thank you
7th Feb 2018, 8:52 PM
Phil Rinaldi
Phil Rinaldi - avatar
+ 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)
7th Feb 2018, 9:48 PM
Fata1 Err0r
Fata1 Err0r - avatar
+ 1
savings = 1000 loan = 4000 total = savings + loan print(total)
7th Feb 2018, 7:44 PM
Fata1 Err0r
Fata1 Err0r - avatar
+ 1
how would input it like a sentence
7th Feb 2018, 8:38 PM
Phil Rinaldi
Phil Rinaldi - avatar
+ 1
thank u so much
7th Feb 2018, 10:41 PM
Phil Rinaldi
Phil Rinaldi - avatar
- 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?
7th Feb 2018, 8:37 PM
Jax
Jax - avatar
- 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.
7th Feb 2018, 8:46 PM
Jax
Jax - avatar
- 1
If you want to use it in a sentence: print(‘You have this much in savings: ‘, savings)
7th Feb 2018, 8:48 PM
Jax
Jax - avatar