I'm trying to write a single line statement that assigns the value of a string to a variable after having ONLY the first letter capitalized, and all other letters left unchanged.
Example, if the string being used were:
myString = 'tHatTimeIAteMyPANTS'
myString2 = 'THatTimeIAteMyPANTS'
Like Barmar said, you can just capitalize the first character and concatenate it with the remainder of the string.
myString = 'tHatTimeIAteMyPANTS' newString = "%s%s" % (myString.upper(), myString[1:]) print(newString) # THatTimeIAteMyPANTS