0% found this document useful (0 votes)
7 views

Python IMP

Uploaded by

Sahil Sayyad
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Python IMP

Uploaded by

Sahil Sayyad
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Strings

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.

o Highlights string manipulation techniques for data extraction.

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.

o Demonstrates basic and commonly used list operations.

Tuples and Dictionaries

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.

o Demonstrates key dictionary operations required for managing structured data.

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

8. Write a Python program to handle a ZeroDivisionError exception when dividing a number by


zero. Explain exception handling with examples.

o Focuses on robust error handling, an essential skill for building reliable programs.

You might also like