In: Computer Science
code in python
write a code where the initial value is compounded by a multiplier, rounded to the nearest tenth
Output:
Initial Value: 10
Multiplier: 1.4
Number of compounds: 10
Your Values are: 10 , 14, 19.6 , 27.4, 38.4, 53.8, 75.3, 105.4, 147.6, 206.6
Answer-
CODE:
initial=int(input("Initial value :
")) #taking inputs
multiplier=float(input("Multiplier : "))
compound=int(input("No of compounds : "))
print("Your values are:")
mult=initial
#initalizing to find answer
for i in
range(0,compound):
#multiplying by multiplier
print(round(mult,1))
mult=mult*multiplier
OUTPUT
NOTE:-Please give a like if the answer helps.