2024 - Unit4 Strings
2024 - Unit4 Strings
• Linear ….
• Decisions - select a flow control for execution.
• Repetition - use flow control to execute code
multiple times.
Strings and string manipulation in
programming
• Strings are a data type
Programming elements
• Literals - _______________________________________
• Variables - ______________________________________
• Keywords (30 in Python … and else elif exec … )
• Comments #
• A keyword is IF and ELIF
• A keyword is FOR
• A keyword is WHILE
• Functions are declared!
STRINGS
• A collection of elements.
• First element index 0, last element index -1
• Length of list len()
• Union
• Intersection
• Difference
• Set methods and functions: len(), max(), min()
Practical application