Python IMP
Python IMP
1. Explain String methods in Python and demonstrate their usage with examples.
o Covers key string methods like split(), join(), strip(), lower(), upper() which are vital for text
processing in data science.
2. What is string slicing? Write a Python program to demonstrate string slicing and traversal with a
for loop.
Lists
3. Explain List datatype in Python. Write and explain any 5 built-in functions or methods of Lists
with examples.
o Covers essential list operations like append(), sort(), pop(), len(), and reverse().
4. Write a Python program to demonstrate list operations like concatenation, repetition, and the in
operator.
5. Explain the difference between tuples and dictionaries with examples. Include key operations for
both.
o Clarifies the unique properties of tuples and dictionaries, focusing on immutability and key-
value pairs.
6. Write a Python program to create a dictionary, update it, access values, and delete elements.
Files
7. Explain text file handling in Python. Write a Python program to read and write data to a file.
o Covers file handling operations (open(), read(), write(), close()), crucial for data
input/output tasks.
Exceptions
o Focuses on robust error handling, an essential skill for building reliable programs.