shouldz

Algoritmo mes POO

Aug 9th, 2018
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. class scanner:
  2. def __init__(self, valor):
  3. self.valor = valor
  4.  
  5. def validar(self):
  6. if 12 >= self.valor > 1:
  7. if self.valor == 1:
  8. print('Janeiro')
  9. if self.valor == 2:
  10. print('Fevereiro')
  11. if self.valor == 3:
  12. print('Março')
  13. if self.valor == 4:
  14. print('Abril')
  15. if self.valor == 5:
  16. print('Maio')
  17. if self.valor == 6:
  18. print('Junho')
  19. if self.valor == 7:
  20. print('Julho')
  21. if self.valor == 8:
  22. print('Agosto')
  23. if self.valor == 9:
  24. print('Setembro')
  25. if self.valor == 10:
  26. print('Outubro')
  27. if self.valor == 11:
  28. print('Novembro')
  29. if self.valor == 12:
  30. print('Dezembro')
  31. else:
  32. print('Número invalido!')
Advertisement
Add Comment
Please, Sign In to add comment