Fala pessoal!

Nossa segunda aula foi demais!. Segue o material complementar
para você fixar melhor tudo que falamos na aula.

👇👇👇
https://www.python.pro.br/r/spp3-material2-tg

8 comments

Obrigado Renzo
Muito Obrigado Renzo.
Acompanhei até a parte em que você desenvolveu e ensinou sobre função, mas começou a dar o erro "File "<stdin>", line 1". Fiquei uma meia hora nisso, até joguei no google mas não deu em nada, aí tiltei, fiquei frustrado e fechei o vs code, desculpa. Amanhã tento novamente.
Luis Brito
Oi Renzo, TD bem? Na segunda aula que vc postou está faltando o começo? Vi o começo mas não pude acompanhar pois estava em trânsito.
Jaimi Passos
"""
Best Full Teacher RENZO!!!
Parabenizo pela tua abordagem que é extremamente eficiente,
fica muito fácil de OBSERVAR e ABSORVER os conhecimentos transmitidos.

Segue uma solução referente a tarefa mencionada.
"""
def fizzbuzz(param, show=False):
# Do loop by param
for number in param:

# Test the division by 2 AND by 5, then write fizzbuzz
if (number % 2) == 0 and (number % 5) == 0:
# Using the ternary if
print(number, ' fizzbuzz') if show else print(' fizzbuzz')
elif (number % 2) == 0:
print(number, ' fizz') if show else print(' fizz')
elif (number % 5) == 0:
print(number, ' buzz') if show else print(' buzz')
else: # Number not be division by 2 or 5, then write number
print(number)

print()
print('####################################################################')
print(' Calling fizzbuzz function with range value list...')
param2=list(range(13))
fizzbuzz(param2)

print()
print('####################################################################')
print(' Calling fizzbuzz function with range value list AND show = True...')
param3=list(range(17))
fizzbuzz(param3, True)


if __name__ == "__main__":
pass

# The ident crash here, but the code is work fine.
Demorou um pouco mais saiu.
Eu ainda não sei colocar para quaisquer intervalo de números, coloquei dentro de uma faixa.