Skip to content

Commit 19688ab

Browse files
author
Tim Yuan
committed
update code
1 parent e737e29 commit 19688ab

19 files changed

+59
-9
lines changed

B_o_S.py

100644100755
File mode changed.

LICENSE

100644100755
File mode changed.

README.md

100644100755
File mode changed.

dict.py

100644100755
File mode changed.

doty.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@
2828
if month > 12 or month < 1:
2929
print'Invaild input'
3030
month = int(input('Input month: '))
31-
if (month in (1,3,5,7,8,10,12) and day > 31) or day < 1:
31+
elif month in (4,6,9,11) and day > 31 or day < 1:
3232
print'Invaild input'
3333
day = int(input('Input day: '))
34-
if (month in (2,4,6,9,11) and day > 31) or day < 1:
34+
elif month in (1,3,5,7,8,10,12) and day > 32 or day < 1:
3535
print'Invaild input'
3636
day = int(input('Input day: '))
37-
if month==2 and day>days:
37+
elif month==2 and day>days:
3838
print'Invaild input'
3939
day = int(input('Input day: '))
4040
tries = tries - 1

hur.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
print(''' hurt myself today
2+
to see if i still feel
3+
i focus on the pain
4+
the only thing that's real
5+
the needle tears a hole
6+
the old familiar sting
7+
try to kill it all away
8+
but i remember everything''')

invest.py

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
1-
amount = int(input('amount:'))
2-
rate = int(input('rate:'))
3-
time = int(input('time(year):'))
4-
finally_amount = 0
5-
finally_amount = amount*(1+rate/100)**time
6-
print('finally amount is',finally_amount)
1+
def control_function():
2+
print('what\'s your choice?\ninvest=0,invest2=1')
3+
choice =int(input('your choice:'))
4+
if choice == 0:
5+
amount = int(input('amount:'))
6+
rate = int(input('rate:'))
7+
time = int(input('time(year):'))
8+
finally_amount = 0
9+
finally_amount = amount*(1+rate/100)**time
10+
print('finally amount is',finally_amount)
11+
elif choice == 1:
12+
amount = int(input('amount:'))
13+
rate = int(input('rate:'))
14+
time = int(input('time(year):'))
15+
print('amount:{}'.format(amount))
16+
for t in range(1,time+1):
17+
amount = amount*(1+rate/100)
18+
print('year {}: ${}'.format(t,amount))
19+
else:
20+
print('invaild input')
21+
control_function()

invest2.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
def invest():
2+
amount = int(input('amount:'))
3+
rate = int(input('rate:'))
4+
time = int(input('time(year):'))
5+
finally_amount = 0
6+
finally_amount = amount*(1+rate/100)**time
7+
print('finally amount is',finally_amount)
8+
invest()
9+
10+
def invest2():
11+
amount = int(input('amount:'))
12+
rate = int(input('rate:'))
13+
time = int(input('time(year):'))
14+
print('amount:{}'.format(amount))
15+
for t in range(1,time+1):
16+
amount = amount*(1+rate/100)
17+
print('year {}: ${}'.format(t,amount))
18+
invest2()

multip.py

100644100755
File mode changed.

pi.py

100644100755
File mode changed.

0 commit comments

Comments
 (0)