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. print 'Else: ' + char
  13. numCons -= 1
  14.  
  15. print 'numVowels is: ' + str(numVowels)
  16. print 'numCons is: ' + str(numCons)
Success #stdin #stdout #stderr 0.03s 42016KB
stdin
Standard input is empty
stdout
M
Else: s
Else: s
Else: c
Else: h
Else: s
Else: t
Else: t
Else: s
Else:  
Else: I
Else: n
Else: s
Else: t
Else: t
Else: t
Else:  
Else: f
Else:  
Else: T
Else: c
Else: h
Else: n
Else: l
Else: g
Else: y
numVowels is: 11
numCons is: -25
stderr
Warning: cannot find your CPU L2 cache size in /proc/cpuinfo