You are on page 1of 2

Unit-3 and Unit-4 Assignment

Explain List with example. Also explain all the features of List.

Lists are used to store multiple items in a single variable.


Lists are one of 4 built-in data types in Python used to store collections of data,
the other 3 are Tuple, Set, and Dictionary, all with different qualities and usage.
Lists are created using square brackets:
Example
Create a List:
thislist = ["apple", "banana", "cherry"]
print(thislist)
List Items
List items are ordered, changeable, and allow duplicate values.
List items are indexed, the first item has index [0], the second item has index [1]
etc.

Differentiate mutable and immutable data types.

What is the difference between append and extend operation in List?

How to manipulate every element in a list with list comprehension?

Count the occurrence of a specific object in a list.

Insert a value at a specific index in an existing list.

WAP to remove the duplicate elements from the list.

State the difference between lists and dictionary.

What is Dictionary? Explain any 5 predefined dictionary methods.

How to add and access elements in dictionary?

Write a Python program to swap two variables using function.

Explain recursion. Write a Python program to find factorial of a no using


recursion.

Write a Python program to perform linear search on List

How can you delete and replace dictionary elements?

Write a Python program to create a function to calculate simple interest.

What is class and object? Write syntax to create a class and declaring object.

Explain the features of Object Oriented Programming (OOP).

What is inheritance? Explain its types with example.

Write a program in python to create employee class having method show to display
the employee name, age, salary and address.

What is constructor? Explain different types of constructor with example.

How super keyword used with inheritance? Explain with example.


What is the significance of keyword self and pass.

What is polymorphism? Explain with example.

What is method overriding? Explain with example

What is abstract class? WAP to create a Shape abstract class having draw() method
and having three subclasses.

Explain the concept of operator overloading. WAP to overload ‘+’ and ‘<’ operator.

What is exception? Write the main components of exceptional handling. WAP to show
exception handling with at least two except block.

You might also like