-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Exercícios feitos do curso de Python- Mundo 1 do Curso em Video
- Loading branch information
0 parents
commit 19dd3b3
Showing
22 changed files
with
125 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
dias = int(input('Quantos dias o carro está alugado?')) | ||
Km = float(input('Quantos quilômetros foram percorridos?')) | ||
pago=(dias*60)+(Km*0.15) | ||
print(f'O total a pagar é R${pago:.2f}') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
n=str(input('Digite seu nome completo: ')).strip() | ||
nome=n.split() | ||
print('Muito prazer em te conhecer!') | ||
print('Seu primeiro nome é {}'.format(nome[0])) | ||
print('Seu último nome é {}'.format(nome[-1])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
frase = str(input('Insira sua frase:')).strip().lower() | ||
print(f'A letra "a" aparece {frase.count("a")} vezes') | ||
print(f'A letra "a" aparece a primeira vez na posição {frase.find("a") + 1}') | ||
print(f'A ultima letra "a" aparece na {frase.rfind("a") + 1}') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
real = float(input('Quanto dinheiro você tem agora? R$')) | ||
dolar = real / 5.56 | ||
print("Com esse valor de R$ {}, você pode comprar Us$ {}". format( real, dolar)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
nome: str = (input('Digite seu nome completo: ')).strip() | ||
print('Analisando seu nome, ele: ') | ||
print('Em maisculas, escreve-se {}'.format(nome.upper())) | ||
print('Em minúsculas, escreve-se{}:'.format(nome.lower())) | ||
print('Seu nome tem {} letras'.format(len(nome) - nome.count(' '))) | ||
print('Seu primeiro nome tem {} letras'.format(nome.find(" "))) | ||
separa = nome.split() | ||
print('Seu primeiro nome é {} e ele tem {} letras'.format(separa[0], len(separa[0]))) | ||
print(nome.capitalize()) | ||
print(nome.title()) | ||
print(nome.split()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
n1= int(input('Distância em metros:')) | ||
a= n1*1000 | ||
b= n1*1000 | ||
c=n1*100 | ||
print('A Distância em milimetros é: {},\n A distâncis em km é: {};\n A distância em centímetros é:{} ;'. format(a,b,c)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
n1 = float(input('Digite a nota: ')) | ||
n2 = float(input('Digite a outra nota: ')) | ||
m = (n1+n2)/2 | ||
print('A média entre {} e {} é igual a {}'.format(n1,n2,m)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
n= str(input('Qual o seu nome?')) | ||
print('O seu nome tem o substantivo Silva?{}'.format('silva' in n.upper())) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Cidade = str(input('Digite o nome da cidade: ')).strip().split() | ||
print(Cidade[0].upper() == "SANTO") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import random | ||
n1 = (input('Digite o nome do aluno: ')) | ||
n2 = (input('Digite o nome do aluno: ')) | ||
n3 = (input('Digite o nome do aluno: ')) | ||
n4 = (input('Digite o nome do aluno: ')) | ||
Lista = [n1,n2,n3,n4] | ||
random.shuffle(Lista) | ||
print('A ordem de escolha é:') | ||
print(Lista) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
larg= float(input('Digite a largura da parede: ')) | ||
alt= float(input('Digite a altura da parede: ')) | ||
Area= larg*alt | ||
print("Sua parede tem a dimensão de {} x {} e sua área é de {} m².".format (larg, alt, Area)) | ||
tinta=Area/2 | ||
print('Para pintar sua parede, você precisará de {}, litros de timta'.format(tinta)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from typing import Any | ||
|
||
preco=float(input('Qual o preço do produto na loja?')) | ||
novo= preco - (preco * 10 / 100) | ||
print(f'O preço promocional de nosso produto é de R$ {novo:.2f}, com o valor promocional de 10%') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
sal=float (input('O salário atual do funcionário é de R$: ')) | ||
novosal= sal + (sal * 15/100) | ||
print(f'O salário de R$ {sal:.2f} do funcionário, com o aumento de 15%, passa a ser de R$ {novosal:.2f}') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
num: int = int(input('Informe um número: ')) | ||
u = num // 1 % 10 | ||
d = num // 10 % 10 | ||
c = num // 100 % 10 | ||
m = num// 1000% 10 | ||
print('Analisando o número:{}'.format(num)) | ||
print('Unidade:{}'.format(u)) | ||
print('dezena:{}'.format(d)) | ||
print('centena:{}'.format(c)) | ||
print('milhar:{}'.format(m)) |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from pygame import mixer | ||
|
||
mixer.init() | ||
mixer.music.load('Sons.mp3.') | ||
mixer.music.play() | ||
(input('Agora você escuta?')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import random | ||
nome1=input("Digite o nome do aluno: ") | ||
nome2=input('Digite o nome do segundo aluno: ') | ||
nome3=input('Digite o nome do terceiro aluno: ') | ||
nome4= input('Digite o nome do quarto aluno: ') | ||
Lista= {nome1, nome2, nome3, nome4} | ||
escolhido= random.choice(Lista) | ||
print('O aluno escolhido foi:{}'.format (escolhido)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
n= int(input('Digite um número:')) | ||
print('{} X {} = {}'.format(n,1,n*1)) | ||
print('{} X {} = {}'.format(n,2,n*2)) | ||
print('{} x {} = {}'.format(n,3,n*3)) | ||
print('{} x {} = {}'.format(n,4,n*4)) | ||
print('{} x {} = {}'.format(n,5,n*5)) | ||
print('{} x {} = {}'.format(n,6,n*6)) | ||
print('{} x {} = {}'.format(n,7,n*7)) | ||
print('{} x {} = {}'.format(n,8,n*8)) | ||
print('{} x {} = {}'.format(n,9,n*9)) | ||
print('{} x {} = {}'.format(n,10,n*10)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
c= float(input('Qual a temperatura local em Celsius?')) | ||
f= ((9*c)/5)+32 | ||
print('A temperatura atual, de C{}, é {} em Fahrenheit!'.format(c,f)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import math | ||
co=float(input('Digite o valor do Cateto Oposto: ')) | ||
ca=float(input('Digite o valor do Cateto Adjacente: ')) | ||
hi=math.hypot(co,ca) | ||
print('A hipotenusa medirá {:.2f}'.format(hi)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# This is a sample Python script. | ||
|
||
# Press Shift+F10 to execute it or replace it with your code. | ||
# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings. | ||
|
||
|
||
def print_hi(name): | ||
# Use a breakpoint in the code line below to debug your script. | ||
print(f'Hi, {name}') # Press Ctrl+F8 to toggle the breakpoint. | ||
|
||
|
||
# Press the green button in the gutter to run the script. | ||
if __name__ == '__main__': | ||
print_hi('PyCharm') | ||
|
||
# See PyCharm help at https://www.jetbrains.com/help/pycharm/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
num = float(input('Digite um número: ')) | ||
print('O número digitado, {}, tem {} como a sua parte inteira.'.format(num, int(num))) | ||
|