Advertisement
Finch_404

codigozin

Apr 5th, 2020
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. # código que fiz em 2017, acho
  2. while True:
  3.     res = input("Sim ou não?\n").lower()
  4.  
  5.     if res.strip() == 'não' or res.strip() == 'nao' or res.strip() == 'sim':
  6.         print('Deu certo')
  7.         break
  8.  
  9.     if res == '':
  10.         print('Você deve digitar algo.')
  11.  
  12.     elif res.strip() == '':
  13.         print('Você não pode digitar apenas espaços.')
  14.  
  15.     else:
  16.         print('Resposta inválida, digite novamente.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement