Module-1
1 Write a Python program using list comprehension to create a list of
squares of even numbers from 1 to 10.
2 A sample of 30 students has an average score of 52. The population
mean is 50 with standard deviation [Link] at 5% significance level
whether the sample mean is significantly different from the population
mean.
3 What is a Confidence Interval. Explain with formula.
4 Compare iterators and generators in Python.
5 Write a Python program to check whether a number is positive using an
assert statement.
6 Write a Python program using defaultdict to count the frequency of
elements in a list.
7 Design a Python program to demonstrate encapsulation by creating a
class Student with private attributes name and [Link] public
methods set_data() and get_data() to assign and display the values.
8 Explain the syntax of list comprehension with an [Link] a
Python program to generate a list of odd numbers from 1 to 15.
9 Describe the difference between *args and **kwargs. Write a Python
program demonstrating both in a single function.
10 Explain the role of matplotlib in data visualization.
11 Implement operator overloading for multiplication (*) in a class.
12 Explain the concept of assertion in Python. Illustrate its syntax with a
program.
13 Design a Python program to demonstrate inheritance by creating a base
class Person with attributes name and age, and a method display() to show
the [Link] a derived class Student that inherits from Person and adds
an attribute marks along with a method show_marks().
14 Explain list comprehension in Python. Apply it to write a Python program
to generate a list of squares for numbers from 1 to 5.
15 Explain *args and **kwargs with example in python.
16 Define iterator in Python. Explain its working with
suitable example and diagram.
17 Explain how a scatter plot is used to represent the relationship between two
variables. Write a Python program using Matplotlib to create a scatter plot
for the following data:Study Hours = [1, 2, 3, 4, 5] and Marks = [50, 55, 65,
70, 80].
18 Define an assert statement. Explain its syntax with an
example.
19 What is the purpose of the assert statement in Python.
20 Discuss operator overloading in Python classes.
21 Explain defaultdict with example in python
22 Design a Python program to demonstrate polymorphism
using method overriding by creating a base class Shape
with a method area().Create derived classes Circle and
Rectangle that override the area() method to calculate
area based on their dimensions.
23 Explain how a line chart is used to represent the relationship between two
variables. Write a Python program using Matplotlib to create a line chart
for the following monthly sales data:
Months = [1, 2, 3, 4, 5, 6]
Sales = [200, 250, 300, 280, 350, 400].
24 Compare iterable and generator in python