Skip to content

Commit f086695

Browse files
committed
update
1 parent f1e4fa2 commit f086695

7 files changed

+73
-0
lines changed

projeto_python_basico/bibliotecas.py

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
from tkinter import *
2+
3+
def funcClicar():
4+
print("Botão pressionado")
5+
6+
janelaPrincipal = Tk()
7+
texto = Label(master = janelaPrincipal, text = "Minha janela exibida")
8+
texto.pack()
9+
10+
pic = PhotoImage(file="logoestacio.jpg")
11+
logo = Label(master = janelaPrincipal, image = pic)
12+
logo.pack()
13+
14+
botao = Button(master = janelaPrincipal, text = 'Clique', command = funcClicar)
15+
botao.pack()
16+
17+
janelaPrincipal.mainloop()
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
class Conta:
2+
def__init__(self, numero, cpf, nomeTitular, saldo):
3+
self.numero = numero
4+
self.cpf = cpf
5+
self.nomeTitular = nomeTitular
6+
self.saldo = saldo
7+
def depositar(self, valor):
8+
self.saldo += valor
9+
def sacar(self, valor):
10+
self.saldo -= valor
11+
def sacar(self,valor):
12+
if self.saldo < valor:
13+
return False
14+
else
15+
self.saldo -= valor
16+
return True
17+
def gerarextrato(self):
18+
print(f"numero:{self.numero}\n cpf:{self.cpf}\nsaldo:{selfsaldo}")
19+
def transfereValor(self,contaDestino,valor):
20+
if self.saldo < valor:
21+
return ("Não existe saldo suficiente")
22+
else:
23+
contaDestino.depositar(valor)
24+
self.saldo -= valor
25+
return("Transferencia Realizada")
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
def taximetro(distancia, multiplicador=1):
2+
largada = 3
3+
km_rodado = 2
4+
valor = (largada + distancia * km_rodado) * multiplicador
5+
return valor
6+
7+
8+
pagamento = taximetro(3.5)
9+
print(pagamento)

projeto_python_basico/fibonacci.py

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
def fibo(n):
2+
if n == 1 or n == 2:
3+
return 1
4+
else:
5+
return fibo(n - 1) + fibo(n - 2)
6+
7+
numero = eval(input("Qual a posição da série de fibonacci você quer? "))
8+
n = numero
9+
fibonacci = fibo(n)
10+
print(f"O número escolhido é {fibonacci}")

projeto_python_basico/logoestacio.jpg

32.6 KB
Loading

projeto_python_basico/teste.py

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
a = 1
2+
while a < 10:
3+
if a % 2 == 0:
4+
break
5+
else:
6+
a += 1
7+
print(a)

projeto_python_basico/try_except.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
try:
2+
num = eval(input("Entre com um número inteiro: "))
3+
print(num)
4+
except NameError:
5+
print("Entre com o valor numérico e não letras")

0 commit comments

Comments
 (0)