'''
Created on Sep 20, 2011

@author: rodger
'''
words = ['computer', 'science', 'is', 'cool']
for w in words:
    w = w.capitalize()
print words

for x in enumerate(words):
    print x

for (i,v) in enumerate(words):
    words[i] = v.capitalize()
print words

def changeup(s):
    rep = ""
    for ch in s:
        rep = rep + ch*2
    return rep



print changeup("Hello world")

title = "the goose is on the loose"
count = 0
pos = 0
while (count < 3 and pos < len(title)):
    if title[pos] == 'o':
        count += 1
    pos += 1
print count

title = "the goose is on the loose"    
count = 0
for i in range(0,len(title)):
    if title[i]== 'o':
        count += 1
    if count >= 3:
        break
print count

title = "the goose is on the loose"
count = min([title.count('o'), 3])
print count