Thursday, October 8, 2020

Python String methods

Python methods for strings
  1.   title()
  2. capitalize()
  3. swapcase()
  4. find()
  5. count()
  6. replace()
  7. isalnum()
  8. format()

print(dir(variable_name)) gives all the functions that can be applied on the variable. If its a string variable, it will list all the functions applicable on strings. 

You can also use print(help(str)) go get all information about strings.

print(help.(str.find)) will give the details on how to use the find() function.

Python methods for objects:
  1. reverse()
  2. clear()
  3. add
  4. append()
  5. update()

No comments:

Post a Comment

Query for finding high dividend paying stocks

 Post the following query in Screen.in, to get list of high dividend yield stocks: Dividend yield > 6 AND Dividend last year > 1000 AN...