Skip to content

Commit 0e963ba

Browse files
committedMar 9, 2022
add
1 parent 792c123 commit 0e963ba

File tree

2 files changed

+50
-3
lines changed

2 files changed

+50
-3
lines changed
 

‎extra/canvas.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ def userclasses(canvas):
1919

2020
def main():
2121
# Initialize a new Canvas object
22-
URL = "https://poquosonschools.instructure.com/"
23-
##go to here to generate new token: https://poquosonschools.instructure.com/profile/settings#
24-
TOKEN = "16829~q54QlzaHtWTasM1ETw769w5XIjO9h1pWAj8JMVBmVoYifJslbyPfDK5JctXMrjza"
22+
URL = "school email here"
23+
TOKEN = "token here"
2524
canvas = Canvas(URL, TOKEN)
2625
flag = True
2726
while flag:
+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
def welcome():
2+
name = str(input("What is your name?"))
3+
print(f"Welcome to Skulling Financial Services, {name}!")
4+
return name
5+
6+
def logic1():
7+
year = 0
8+
yearsleft = int(input("How many years are left until you retire?"))
9+
annualam = int(input("How much can you save annually?"))
10+
saving = 0
11+
spending = 60000
12+
interest = 1.03
13+
yearsretired = 30 - yearsleft
14+
for year in range(yearsleft):
15+
saving = (saving + annualam) * interest
16+
saving = round(saving, 2)
17+
print(f"Year: {year} Savings: ${saving}")
18+
return year,yearsleft,annualam,saving,spending,interest,yearsretired
19+
20+
def logic2(year,yearsleft,annualam,saving,spending,interest,yearsretired):
21+
for year in range(yearsretired):
22+
saving = (saving - spending) * interest
23+
saving = round(saving, 2)
24+
print(f"Year: {yearsleft+year} Savings: ${saving}")
25+
if saving-spending <= 0:
26+
print(f"You will run out of savings in year: {yearsl +year}")
27+
break
28+
29+
def goodbye(name):
30+
print(f"Thanks for using Skulling Financial Services, {name}!")
31+
32+
def main():
33+
keepgoing = "Y"
34+
while keepgoing == "y" or keepgoing == "Y":
35+
name = welcome()
36+
year,yearsleft,annualam,saving,spending,interest,yearsretired = logic1()
37+
logic2(year,yearsleft,annualam,saving,spending,interest,yearsretired)
38+
keepgoing = input("Do you want to continue? Enter Y to continue.")
39+
40+
goodbye(name)
41+
42+
main()
43+
44+
45+
46+
47+
48+

0 commit comments

Comments
 (0)
Please sign in to comment.