Skip to content

Commit 782bcbf

Browse files
committed
Updated
1 parent 75633c1 commit 782bcbf

File tree

3 files changed

+22
-22
lines changed

3 files changed

+22
-22
lines changed

ex029.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Escreva um programa que leia a velocidade de um carro. Se ele ultrapassar 80Km/h, mostre uma mensagem dizendo que ele
2-
# foi multado. A multa vai custar R$7,00 por cada Km acima do limite.
3-
velocidade = float(input('Digite a velocidade do seu carro:'))
4-
if velocidade > 80:
5-
print('MULTADO! Você exedeu o limite permitido que é de 80km/h')
6-
multa = (velocidade - 80) * 7
7-
print('Você deverá pagar uma multa de R${}.'.format(multa))
8-
print('Tenha um bom dia! Dirija com segurança!')
1+
# Write a program that reads the speed of a car. If it exceeded 80km/h, show a message saying that it
2+
# was fined. The fine will cost R$7.00 for each km above the limit.
3+
speed = float(input('Enter the speed of your car:'))
4+
if speed > 80:
5+
print('FINED!!!! You have exceeded the 80Km/h limit.')
6+
fined = (speed - 80) * 7
7+
print(f'You will need for a fine of R${fined}.')
8+
print(f'Have a nice day! Drive safely!')

ex030.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# Crie um programa que leia um número inteiro e diga se ele é par ou ímpar.
2-
num = int(input('Me diga um número qualquer:'))
3-
resultado = num % 2
4-
if resultado ==0:
5-
print('O número {} é par.'.format(num))
1+
# Create a program that reads an integer and tells you whether it is even or odd.
2+
number = int(input('Enter a number:'))
3+
result = number % 2
4+
if result ==0:
5+
print(f'The number {number} its even.')
66
else:
7-
print('O número {} é impar.'.format(num))
7+
print(f'The number {number} its odd.')

ex031.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# Desenvolva um programa que pergunte a distância de uma viagem em km. Calcule o preço da passagem, cobrando R$0,50 por
2-
# km para viagens até 200km e R$0,45 para viagens mais longas.
3-
distancia = float(input('Qual a distância da sua viagem?'))
4-
print('Você está preste a começar uma viagem de {}km.'.format(distancia))
5-
if distancia <= 200:
6-
preço = distancia * 0.50
1+
# Develop a program that asks the distance of a trip in km. Calculate the ticket price, charging R$0.50 per
2+
# km for trips up to 200km and R$0.45 for longer trips.
3+
distance = float(input('What is the distance of your travel?'))
4+
print(f'You wil stard a travel of {distance}km.')
5+
if distance <= 200:
6+
price = distance * 0.50
77
else:
8-
preço = distancia * 0.45
9-
print('E o preço da sua passagem será de R${:.2f}.'.format(preço))
8+
price = distance * 0.45
9+
print(f'And the price of your ticket will be R${price}.')

0 commit comments

Comments
 (0)