# This program: # - gets a string from the user. # - creates a new string, equal to what the user typed, except that # the third letter is "A". # - prints the new string. # # Compared to change_third_letter.py, this is a different (but equivalent) # implementation. The behavior is the same, but the code is much shorter # here. my_string = raw_input("please enter a string: ") if (len(my_string) >= 3): my_string = my_string[0:2] + "A" + my_string[3:] print "the modified string is", my_string