how to capitalize specific letters in python code example

Example 1: how do you change a string to only uppercase in python

original = Hello, World!

#both of these work
upper = original.upper()
upper = upper(original)

Example 2: Python Program to count the number of lowercase letters and uppercase letters in a string.

string=raw_input("Enter string:")
count1=0
count2=0
for i in string:
      if(i.islower()):
            count1=count1+1
      elif(i.isupper()):
            count2=count2+1
print("The number of lowercase characters is:")
print(count1)
print("The number of uppercase characters is:")
print(count2)

Example 3: capitalize first letter of each word python

"hello world".title()
'Hello World'
>>> u"hello world".title()
u'Hello World'

Example 4: python string replace letters with numbers

from string import ascii_letters

code = code = "1111702460830000Lu05"
code = "".join([str(ascii_letters.index(c)) if c in ascii_letters else c for c in code])
print(code)