Professional Documents
Culture Documents
Python Programming EB CA2
Python Programming EB CA2
SET – I
MM: 30 CLASS: ______ DATE: _______ TIME: 1 hr
Q1. Write the output of the following:[10]
1. week = [‘sun’,’mon’,’tue’,’wed’,’feb’,’thu’,’fri’,’sat’]
week[4:5]=[]
week
2. s = “deepak is very caring and loving”
str.capitalize(s)
3. num = [1,2,3,4,5]
num.pop()
num
num.pop(1)
num
4. p = [2**x for x in range(10) if x%2==0]
print(p)
Q2. Write a program to use special methods(__lt__,__gt__,__le__) and compare two objects.
Q3. Write a program that has a class Circle. Use a class variable to define the values of constant Pi. Use
this class variable to calculate area and circumference of a circle with specified variables.[10]
Q2. Write a function histogram that take string as parameter and generate a frequency of character in
it.[10]
Q3. Write a program to override Display() method in multiple inheritance.[10]