Notes To (“Python Crash Course”, 2023)

METHODS

  • title () ~ changes each word to a title case (each word begins with capital letter
    • example: print(name.title())
  • upper() ~ changes all letters in every word to uppercase
    • example: print(name.upper())
  • lower() ~ changes all letters in every word to lowercase
    • example: print(name.lower())
  • rstrip() ~strips whitespace on the right of a string
  • lstrip() ~ strips whitespace on the left of a string
  • My Examples
  • removeprefix() ~ removes a prefix from a string
  • My example:
  • My example (to remove the prefix and assign it to a new value):
(“Python Crash Course”, 2023)

Pages: 1 2 3 4