Skip to content

Commit 83c123c

Browse files
committed
updated
1 parent 2fb0b77 commit 83c123c

File tree

2 files changed

+19
-17
lines changed

2 files changed

+19
-17
lines changed

ex038.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
second_number = int(input('Enter other integer:'))
77
if first_number > second_number:
88
print(f'The number {first_number} is greater than {second_number}.')
9-
elif n1 < n2:
10-
print('O número {} é maior que o {}.'.format(n2, n1))
9+
elif first_number < second_number:
10+
print(f'The number {second_number} is greater than {first_number}.')
1111
else:
12-
print('Os dois números são iguais!')
12+
print('The two numbers are the same!')

ex039.py

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1-
# Faça um programa que leia o ano de nascimento de um jovem e informe, de acordo com a sua idade, se ele ainda vai se
2-
# alistar ao serviço militar, se é a hora exata de se alistar ou se já passou do tempo do alistamento. Seu programa também deverá mostrar o tempo que falta ou que passou do prazo.
1+
# Write a program that reads the year of birth of a young person and informs, according to his age, whether he is
2+
# still going to enlist in the military service, whether it is the exact time to enlist or if it is past the
3+
# enlistment period. Your program should also show the time remaining or the time that has passed.
4+
35
from datetime import date
46
from xml.sax.handler import property_interning_dict
57

6-
atual = date.today().year
7-
nasc = int(input('Digite o ano do seu nascimento:'))
8-
idade = atual - nasc
9-
print('Quem nasceu em {} tem {} anos.'.format(nasc, idade))
10-
if idade == 18:
11-
print('Você deve se alistar IMEDIATAMENTE.')
12-
elif idade < 18:
13-
saldo = 18 - idade
14-
print('ainda faltam {} anos para o seu alistamento.'.format(saldo))
15-
elif idade > 18:
16-
saldo = idade - 18
17-
print('Você já deveria ter se alistado há {} anos.'.format(saldo))
8+
year = date.today().year
9+
birth = int(input('Enter your year of birth:'))
10+
age = year - birth
11+
print(f'Who was born in {birth} is {age} years old.')
12+
if age == 18:
13+
print('You must enlist IMMEDIATELY!!')
14+
elif age < 18:
15+
result = 18 - age
16+
print(f'Still missing {result} years for your enlistment.')
17+
elif age > 18:
18+
result = age - 18
19+
print(f'You should have enlisted {result} years ago.')

0 commit comments

Comments
 (0)