Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
287 views
in Technique[技术] by (71.8m points)

python 3.x - How do I start using a .json file to read and write variables externally?

In this situation, I want these 4 variables to be saved in an external .json file. If they are not present in the .json file, then I want these questions to be asked. They are global variables.

monthlyWage = int(input("What is your monthly wage? "))
monthlySpendings = int(input("What are your monthly spendings? ")) 
monthlyOverdraft = int(input("What is your monthly overdraft? "))
monthlySavings = int(input("How much do you add into your savings account per month? "))
totalSpendings = int(monthlySpendings + monthlyOverdraft + monthlySavings)

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...