fork download
  1. school = 'Massachusetts Institute of Technology'
  2. numVowels = 0
  3. numCons = 0
  4.  
  5. for char in school:
  6. if char == 'a' or char == 'e' or char == 'i' \
  7. or char == 'o' or char == 'u':
  8. numVowels += 1
  9. elif char == 'o' or char == 'M':
  10. print char
  11. else:
  12. numCons -= 1
  13.  
  14. print 'numVowels is: ' + str(numVowels)
  15. print 'numCons is: ' + str(numCons)
Success #stdin #stdout #stderr 0.04s 42016KB
stdin
Standard input is empty
stdout
M
numVowels is: 11
numCons is: -25
stderr
Warning: cannot find your CPU L2 cache size in /proc/cpuinfo