Capitalize a primeira letra em Python
s = "python"
print("Original string:")
print(s)
print("After capitalizing first letter:")
print(s.capitalize())
Itchy Impala
s = "python"
print("Original string:")
print(s)
print("After capitalizing first letter:")
print(s.capitalize())
def decapitalize(str):
return str[:1].lower() + str[1:]
print( decapitalize('Hello') ) # hello
# Use title() to capitalize the first letter of each word in a string.
name = "elon musk"
print(name.title())
# Elon Musk