1. a)Describe about different Logical operators in Python with appropriate examples.
b)Write a program to find the square root of a number.
2. a)Write a program that takes the marks of 5 subjects and displays the grades.
b)Write a Python program that takes a number and checks whether it is a palindrome or not using
for loop.
3. a)Write a Python program to print all even numbers between 1 to 100 using while loop.
b)Write a python program to find Fibonacci series for given number.
4. a)Describe Keyword "continue" with example.
b)Write program to demonstrate use of break.
5.a) Write a Python program to find common items from two lists.
b)Write a Python program to sort a list by descending order.
6. Write python program to use built-in functions/methods on list:
cmp, len, max, list, append, count, extend, insert, pop, remove.
7. a)Create a tuple and find the minimum and maximum number from it.
b)Write a Python program to find the repeated items of a tuple.
8. a)Write a Python program to find maximum and the minimum value in a set.
b)Write a Python program to find the length of a set.
9. Write a Python program to perform following operations on set: intersection of sets,
union of sets, set difference, symmetric difference, clear a set.
10. a)Write a Python script to sort (ascending and descending) a dictionary by value.
b) What is the output of the following program?
dictionary1 = {'Google' : 1, 'Facebook' : 2, 'Microsoft' : 3}
dictionary2 = {'GFG' : 1, 'Microsoft' : 2, 'Youtube' : 3 }
dictionary1.update(dictionary2)
for key, values in dictionary1.items():
print(key,values)
11. Write a Python script to concatenate following dictionaries to create a new one.
Sample Dictionary:
dic1 = {1:10, 2:20}
dic2 = {3:30, 4:40}
dic3 = {5:50,6:60}
12. a)Write a Python function to calculate the factorial of a number (a non-negative integer).
b)Write a Python function that accepts a string and calculate the number of upper case letters
and lower case letters.
13. Explain function with keyword argument with proper example.
14. Write Python program to demonstrate use of following advanced functions: lambda, map.
15. Write a Python program to create a user defined module that will ask your college name and will
display the name of the college.
16. Write a python program to demonstrate the use of following
module: 1. Math module 2. Random module
17. Explain how to create your own package in Python with appropriate example.
18. Write a Python class named Rectangle constructed from length and width and a method that
will compute the area of a rectangle.
19. Write a python program to implement parameterized constructor.
20. Write a Python program to create a class 'Degree' having a method 'getDegree' that prints "I
got a degree". It has two subclasses namely 'Undergraduate' and Postgraduate' each having a
method with the same name that prints "I am an Undergraduate" and "I am a Postgraduate"
respectively. Call the method by creating an object of each of the three classes.
21. Write a Python program to implement multiple inheritance.
22. State the importance of Tkinter package in Python.
Write GUI program to import Tkinter package and create a window and set its title.