input :ash.capitalize()
output:'Abv dfgrjjdhjheyooadfhshfheyoohey2255'
input:ash.islower()
output:True
why is the output of islower()
method true even though the first character of the "ash" string is in uppercase.
input :ash.capitalize()
output:'Abv dfgrjjdhjheyooadfhshfheyoohey2255'
input:ash.islower()
output:True
why is the output of islower()
method true even though the first character of the "ash" string is in uppercase.
ash.capitalize() does not change the value of ash to Abv dfgrjjdhjheyooadfhshfheyoohey2255 . Instead, it returns a string which needs to be stored in another variable.
Hence, if we call islower()
on ash
, it is still all lower case.
An example of how it should be done:-
x = "abv dfgrjjdhjheyooadfhshfheyoohey2255";
y = x.capitalize();
print y.islower();
Documentation for the same:-