-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1.py
67 lines (47 loc) · 1.28 KB
/
1.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
deposit=input("deposit?")
annualfees=input("annual fee?")
months=input("which month?")
print("""
I gotta get a ${}
with fee ${}
with month {}
""".format(deposit,annualfees,months)
)
print("""
I gotta get a ${1}
with fee ${0}
with month {2}
""".format(annualfees,deposit,months)
)
#counting number starts from 0
#the 1, 0, 2 changes the sequence, so the above two coes
#have the same output
#for more formatting, gotta change type to float first
deposit=float(input("deposit?"))
annualfees=float(input("annual fee?"))
months=input("which month?")
print("""
I gotta get a ${1:8.2f}
with fee ${0:4.2f}
with month {2}
""".format(annualfees,deposit,months))
#8 spaces for numeric printout with 2 dp.
# 87654321
# 3.22
# the . and the dp counted too
deposit=input("deposit?")
annualfees=input("annual fee?")
months=input("which month?")
print("""
I gotta get a ${}
with fee ${}
with month {}
""".format(float(deposit),float(annualfees),float(months))
)
print(deposit)
#for this above, the deposit won't change
currency = input("What currency u wan")
rate=float(input("what rate"))
amt=float(input("how much"))
convert=float((rate*amt))
print("S$\t{0} x\t{1} = {2} {3}".format(amt,rate,currency,convert) )