Mundo em Python

Valor Futuro

from tkinter import *
root = Tk()
root.geometry("400x350")
root.resizable(0, 0)
root.config(bg="#d9ead3")
def app():
vp = Valor_Presente.get()
a = prazo.get()
juros =tx_juro.get()
jurospp = juros/100
r = (1+jurospp)
f = pow(r,a)
fv = vp*f
fvarr =round(fv,2)
resultado.set(fvarr) def limpar():
Valor_Presente_entrada.delete(0, END)
prazo_entrada.delete(0, END)
tx_juro_entrada.delete(0, END)
root.title("Valor Futuro ")
titulo = Label(text="Valor Futuro",
font=("Arial", "15", "bold"),bg="#d9ead3",fg="#bf9000")
titulo.place(relx=0.35, rely=0.05)
texto_sub1 = Label(text="Valor Presente:",
font=("Arial", "12", "bold"),bg="#d9ead3",fg="#bf9000")
texto_sub1.place(relx=0.15, rely=0.2)
texto_sub2 = Label(text="Número de Períodos:",
font=("Arial", "12", "bold"),bg="#d9ead3",fg="#bf9000")
texto_sub2.place(relx=0.05, rely=0.35) texto_sub3 = Label(text="Taxa de Juros (em %):",
font=("Arial", "12", "bold"),bg="#d9ead3",fg="#bf9000")
texto_sub3.place(relx=0.05, rely=0.5)
Valor_Presente = DoubleVar()
Valor_Presente_entrada = Entry(textvariable=Valor_Presente,
font=("Arial", "12", "bold"),
bg="white", fg="blue", justify='center')
Valor_Presente_entrada.place(relx=0.55, rely=0.2, relwidth=0.3) prazo = IntVar()
prazo_entrada = Entry(textvariable=prazo,
font=("Arial", "12", "bold"),
bg="white", fg="blue", justify='center')
prazo_entrada.place(relx=0.55, rely=0.35, relwidth=0.3) tx_juro = DoubleVar()
tx_juro_entrada = Entry(textvariable=tx_juro,
font=("Arial", "12", "bold"),
bg="white", fg="blue", justify='center')
tx_juro_entrada.place(relx=0.55, rely=0.5, relwidth=0.3) but1 = Button(text="Calcular", bd=2, bg='#107db2', fg='white',
font=('verdana', 12, 'bold'), command=app)
but1.place(relx=0.05, rely=0.65, relwidth=0.25, relheight=0.1)
but_limpar = Button(text="Limpar", bd=2, bg='#107db2', fg='white',
font=('verdana', 12, 'bold'), command=limpar)
but_limpar.place(relx=0.35, rely=0.65, relwidth=0.25, relheight=0.1) but_sair = Button(text="Sair", bd=2, bg='#107db2', fg='white',
font=('verdana', 12, 'bold'), command=root.destroy)
but_sair.place(relx=0.65, rely=0.65, relwidth=0.25, relheight=0.1)
texto_sub4 = Label(text="Valor Futuro:",
font=("Arial", "12", "bold"),bg="#d9ead3",fg="#bf9000")
texto_sub4.place(relx=0.2, rely=0.85) resultado = StringVar() resultado_texto = Label(textvariable=resultado,
font=("Arial", 12, "bold"), bg="#cfe2f3")
resultado_texto.place(relx=0.5, rely=0.85, relwidth=0.25,relheight=0.1)
root.mainloop()
0