This file contains hidden or 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
n = float(input('Quanto custa o produto?')) | |
print('O produto com 5% de desconto fica R${}'.format(n - n*(5/100))) |
This file contains hidden or 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
n = float(input('Qual é seu salário? ')) | |
print('Seu salário é de R${} e com o aumento de 15% passará a ser de R${}'.format(n, n+n*(15/100))) |
This file contains hidden or 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
l = float(input('Quantos metros de largura tem? ')) | |
a = float(input('Quantos metros de altura tem? ')) | |
t = l * a | |
lt = 2 | |
print('Para pintar uma parede de {}m2 será necessário {} litros de tinta'.format(t, t/lt)) |
This file contains hidden or 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
n = int(input('Digite um número: ')) | |
print('Tabuada de {0} \n {0}x0={1} \n {0}x1={2} \n {0}x2={3} \n {0}x3={4} \n {0}x4={5} \n {0}x5={6}'.format(n, n*0, n*1, n*2, n*3, n*4, n*5)) | |
print(' {0}x6={1} \n {0}x7={2} \n {0}x8={3} \n {0}x9={4}'.format(n, n*6, n*7, n*8, n*9)) | |
This file contains hidden or 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
n = float(input('Quantos metros?')) | |
print('Isso tem {} metros, {} centímetros e {} milímetros'.format(n, n*100, n*1000)) |
This file contains hidden or 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
n1 = float(input('Primeira nota: ')) | |
n2 = float(input('Segunda nota: ')) | |
print('A sua média entre {} e {} é {}'.format(n1, n2, (n1 + n2)/2)) |
This file contains hidden or 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
C = float(input('Informe a temperatura em °C:')) | |
F = (C * 1.8) + 32 | |
print('A temperatura de {:.1f}°C corresponde a {:.1f}°F!'.format(C, F)) |
This file contains hidden or 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
Di = int(input('Quantos dias alugados?')) | |
Km = float(input('Quantos Km rodados?')) | |
K = Km * 0.15 | |
D = Di * 60 | |
print('O total a pagar é de R${:.2f}'.format(K + D)) | |
This file contains hidden or 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
frase = input('Digite uma frase: ') | |
fr1 = frase.lower() | |
fr2 = fr1.count('a') | |
fr3 = fr1.find('a') | |
fr4 = fr1.rfind('a') | |
print(''' A frase > {} < tem {} letras (a) \n A primeira letra (a) aparece na casa {} | |
A ultima letra (a) aparece na casa {}'''.format(frase, fr2, fr3, fr4)) |
This file contains hidden or 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
nome = input('Digite um nome: ') | |
nome1 = nome.split() | |
qua = len(nome1) | |
pri = nome1[0] | |
ult = nome1[qua-1] | |
print('Nome: {} \nPrimeiro nome: {}\nÚltimo nome: {}'.format(nome, pri, ult)) |