-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathloop.txt
More file actions
58 lines (41 loc) · 1.12 KB
/
Copy pathloop.txt
File metadata and controls
58 lines (41 loc) · 1.12 KB
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
principle=0
rate=0
time=0
while principle <=0:
principle=float(input("enter the principle:"))
if principle <=0 :
print("principle can't be less than ")
while rate <=0:
rate =float(input("enter the rate: "))
if rate <=0 :
print("rate can't be less than ")
while time <=0:
time =float(input("enter the time:"))
if time <=0 :
print("time can't be less than ")
total = principle *pow(1+rate/100 ,time)
print(f"result is {total: .2f}")
#####################################################"
principle=0
rate=0
time=0
while True:
principle=float(input("enter the principle:"))
if principle <=0 :
print("principle can't be less than ")
else:
break
while True:
rate =float(input("enter the rate: "))
if rate <=0 :
print("rate can't be less than ")
else:
break
while True:
time =float(input("enter the time:"))
if time <=0 :
print("time can't be less than ")
else:
break
total = principle *pow(1+rate/100 ,time)
print(f"result is {total: .2f}")