fork download
  1. def capitalise():
  2. new_words = ""
  3. i=0
  4. for elem in words:
  5. if i == 0:
  6. elem = ord(elem) - 32
  7. elem = chr(elem)
  8.  
  9. if elem == " ":
  10. i = 0
  11. else:
  12. i = 1
  13.  
  14. new_words += elem
  15. return new_words
  16.  
  17. words = "dsgdfh fhkty7o cncvn.xbcgj"
  18. print capitalise()
Success #stdin #stdout 0.01s 9016KB
stdin
Standard input is empty
stdout
Dsgdfh Fhkty7o Cncvn.xbcgj