-2
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.

AGN Gazer
  • 7,569
  • 2
  • 21
  • 43
nag_codes
  • 1
  • 1

1 Answers1

0

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:-

capitalize function

AGN Gazer
  • 7,569
  • 2
  • 21
  • 43
Echo
  • 522
  • 1
  • 8
  • 20