saving . . . saved change s='hello' to s='Hello'. has been deleted. change s='hello' to s='Hello'. has been hidden .
change s='hello' to s='Hello'.
Title
Question
cant we reassign s='Hello' or use capatilize fn(s=s.capitalize)?


Python-3.4.3 Getting-started-with-strings 08-09 min 50-60 sec 30-06-20, 10:46 p.m. alpha_death_rider

Answers:

You can take these steps. Out of the two, capitalize is a better answer because you are supposed to convert the string and not reassign. However the tutorial does not cover capitalize and hence that is not provided as an answer.
08-07-20, 6:03 p.m. ankitrj.iitb


s = 'hello'
s = s.capitalize()
print(s) # Output will be 'Hello'
14-05-24, 1:08 a.m. kumarkaseraaman@gmail.com


s = 'hello'
s = s.capitalize()
print(s)  # Output will be 'Hello'

14-05-24, 1:09 a.m. kumarkaseraaman@gmail.com


s = 'hello'
s = s.capitalize()
print(s)  # Output will be 'Hello'

14-05-24, 1:09 a.m. kumarkaseraaman@gmail.com


Log-in to answer to this question.