IT 11 – Python Programming
Lab Manual
Q.1. Write a program to create dictionary from list and tuple.
Note: Using for loops
Given:
names=["ajay","sneha","vivek","pooja","sagar","riddhi"]
roll_nos=(101,102,103,104,105,106)
Perform operations:
1. Create a dictionary from above list and tuple
Output :
{'ajay': 101, 'sneha': 102, 'vivek': 103, 'pooja': 104, 'sagar': 105, 'riddhi': 106}
Assignment for Q1.
1) Explain list in python ? Explain any 10 methods of list.
2) Explain dictionary in python ? Explain update() in details?
3) Explain different loops in python.
Q.2. Write a program to print the Fibonacci series using function.
Assignment for Q.2:
1) Explain any 10 built in function in python.
Q.3. Create a module name ‘Calculate’ and add 4 methods in it add(),substract(),multiply(), and
divide(), create another module named as ‘operations’ and import ‘Calculate’ module in it and use
its function.
Assignment for Q.3.
1) Explain user-defined module in python
2) Explain any 2 built in modules in python.
Q.4. Write a program to demonstrate the use of Multilevel inheritance?
Assignment for Q. 4:
1) Explain inheritance in python?
2) Explain static method , instance method and class method in python.
3) Explain the concept of polymorphism in python ?
Q.5 Write a program to validate strong password using regular expression ?
Note : password must have following
a) must have 8 characters long
b) must have at least 1 capital, 1 small and 1 special character
c) must have at least 1 number
Assignment for Q.5 :
1) Explain Regular expression in python ? explain various components used in regular expression.
Q.6. Write a program to demonstrate the exception handling mechanism in python?
Assignment for Q.6 :
1) What is exception handling in python ? explain user defined exception in python.
Q.7. Write a program and create 2 threads in python , one should print square of a numbers (1-10)
while other should print the cube of the numbers. ( 1-10)
Assingment for Q.7 :
1) What is Multithreading in python, Explain in details?
Q.8. Write Programs to perform searching, adding, updating the content from the file.
Assignment for Q.8:
1) Explain file handling mechanism in python?
Q.9. Write a pythan program to perform following operations. on MongoDB
Database.
i) Create collection “EMP” with fields:
Emp-name, Emp- mobile, Emp, sal, Age
ii) Insert 5 documents.
iii) Find the employees getting salary between 5000 to 10000.
iv) Update mobile number for the employee named as “Riddhi”
v) Display all employees in the order of “Age”
Assignement for Q.9 :
1) What is NoSql database
2) Explain difference between RDBMS and NoSql
3) Write advantages and disadvantages of NoSql
Q.10. Create a django project which contain login page and if user enters username=”iims” and
password=”python” then redirect user to dashboard which having welcome message.
Assignment for Q.10 :
1) Explain project structure in django
2) Explain models in python