The below is my code, and as you can guess, I am trying to change the input's first to upper, and rest to lower.
name = input("Your name: ")
name.lower()
name[0].upper()
print(name)
But on the interpreter I get the exact same variable!
The below is my code, and as you can guess, I am trying to change the input's first to upper, and rest to lower.
name = input("Your name: ")
name.lower()
name[0].upper()
print(name)
But on the interpreter I get the exact same variable!
Its what that str.capitalize
is for :
>>> name='name'
>>> name.capitalize()
'Name'
Note that your command name[0].upper()
just return the first character in upper mode!