@valoro/

capcompuesta2

Python

https://altocodigo.blogspot.com/2018/08/capitalizacion-compuesta-en-python.html

fork
loading
Files
  • main.py

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.41552092658312834","path":"main.py","file":{"path":"main.py","content":{"asEncoding":{"base64":"aW1wb3J0IHJhbmRvbQpkZWYgbW9udGFudGUoQyxuLGkpOgogIHJldHVybiBDKigxK2kpKipuCkM9cmFuZG9tLnJhbmRpbnQoMTAwMCw5OTk5KQpwcmludCgnQ2FwaXRhbCBpbmljaWFsPScsQykKbj1yYW5kb20ucmFuZGludCgxLDEwKQpwcmludCgnYcOxb3M9JyxuKQppPXJhbmRvbS5yYW5kaW50KDIsMjApLzEwMApwcmludCgnVGlwbyBkZSBpbnRlcsOpcyBhbnVhbD0nLGkpCnByaW50KCdDYXBpdGFsIGZpbmFsPScscm91bmQobW9udGFudGUoQyxuLGkpLDIpKQ=="},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
import random
def montante(C,n,i):
  return C*(1+i)**n
C=random.randint(1000,9999)
print('Capital inicial=',C)
n=random.randint(1,10)
print('años=',n)
i=random.randint(2,20)/100
print('Tipo de interés anual=',i)
print('Capital final=',round(montante(C,n,i),2))