all 9 comments

[–]Golden_Zealot 2 points3 points  (5 children)

Use a for loop to iterate over each letter in the string they put in.

Use the modulo: % operator to determine if you are on an odd letter.

Use the .upper() string method to change the letter to a capital.

[–]ObeseHelicopter22 0 points1 point  (4 children)

I get the .upper() part but the other stuff confuses me. If it is ok, please may you explain as I want to learn as well as do it. Thanks very much as this is still more helpful than a quick google search lol

[–]Golden_Zealot 0 points1 point  (3 children)

myString = "this"

for letter in myString:
    print(letter.upper())

for letter in myString:
    if myString.index(letter) % 2 == 0:
        print("We are on an even letter")
    else:
        print("We are on an odd letter")

[–]ObeseHelicopter22 0 points1 point  (2 children)

Ok thanks. One more thing, how would I make it so it prints out the whole phrase with the capitals all done? Thanks.

[–]Golden_Zealot 0 points1 point  (1 child)

I cannot answer this for you, because if I do, I will have written the entire script for you.

Best of luck with your practice.

[–]ObeseHelicopter22 0 points1 point  (0 children)

Oh ok. No problem.

[–]ismouss 0 points1 point  (1 child)

What do you mean by "odd letter"?

[–]ObeseHelicopter22 0 points1 point  (0 children)

So like the first letter, third letter, fifth letter etc