Mushi

Studying functions and conditionals

Feb 28th, 2023 (edited)
1,050
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.44 KB | Software | 0 0
  1. def exercise1(nome):
  2.     print("hello, %s" % nome)
  3.    
  4. def exercise2():
  5.     nome =  input("Digite seu nome: ")
  6.     idade =  input("Digite sua idade: ")
  7.     print("ola, %s de %s anos" % (nome, idade))
  8.  
  9. option = int(input("Escolha um exercicio: "))
  10. if option == 1:
  11.    exercise1("George")
  12.    exercise1("Ferdinand")
  13. elif option == 2:
  14.     exercise2()
  15. elif option == 3:
  16.     print("hai hai")
  17. else:
  18.     print("Escolha uma opcao valida")
  19.  
Advertisement
Add Comment
Please, Sign In to add comment