-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
  • 8,025
  • 2
  • 27
  • 45
nag_codes
  • 1
  • 2

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
  • 8,025
  • 2
  • 27
  • 45
Echo
  • 570
  • 1
  • 7
  • 21