BASIC STRING METHODS

STRING METHODS

Basic OOP

• Everything in Python is an object.
• Every object has a type.
• 'apple' is an object of type "str".
• 'apple' is a string object.
• Fruit = 'apple'.
    • fruit is a string object.
• Methods are fuctions run against an object.
    object.method()
• String methods:
    • upper() : Returns a copy of the string in uppercase.
    • lower() : Returns a copy of the string in lowercase.
    • format() : Returns a formatted version of the string.

The lower() String Method

The upper() String Method

STRING REPETITION OPERATOR

STRING USING STRING()