Contador de vocales


/ Published in: Python
Save to your folder(s)

Cuenta vocales en la input.


Copy this code and paste it in your HTML
  1. ini = True
  2.  
  3. while ini:
  4. res = input('Escribe algo y se contarán las vocales ')
  5. a = res.count('a')
  6. e = res.count('e')
  7. i = res.count('i')
  8. o = res.count('o')
  9. u = res.count('u')
  10. print('Tu enunciado tiene:\n', str(a),
  11. 'a\'s\n', str(e), 'e\'s\n', str(i), 'i\'s\n',
  12. str(o), 'o\'s\n', str(u), 'u\'s\n')
  13. a = input('Otra ves? ')
  14. a = ''.join(a.split())
  15. if a.lower().startswith('s'):
  16. ini = True
  17. else:
  18. ini = False

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.