exercicio de condicional:
print('-'*10,'solução 1', '-'*10)
name = input('what is your name? ')
age = int(input('how old are you? '))
def driving_age_verification (persons_name, age_verification):
if (age_verification < 18) :
print(f'{persons_name}, you cant drive')
else :
print(f'{persons_name}, you can drive')
driving_age_verification(name, age)
print('-'*10,'solução 2', '-'*10)
name = input('what is your name? ')
age = int(input('how old are you? '))
def driving_age_verification2 (name, age):
if (age < 18) :
print(f'{name}, you cant drive')
else :
print(f'{name}, you can drive')
driving_age_verification2(name,age)
exercício de conversão:
print('-'*10,'solução 1', '-'*10)
def driving_age_verification_noparameters():
name = input('what is your name? ')
age = int(input('how old are you? '))
if (age < 18) :
print(f'{name}, you cant drive')
else :
print(f'{name}, you can drive')
driving_age_verification_noparameters()