N. G.
Patel Polytechnic
Advanced Python Programming
IMP Questions
Unit I: Basic of Python Data Structure - Dictionary,
Tuple, and Set
Que. Question
No.
1 Give the difference between Tuple and List in Python. (repeated 2 times)
2 Define Set and how is it created in Python? (repeated 2 times)
3 What is Dictionary in Python? (repeated 2 times)
4 What is a list in Python?
5 What are lists and tuples? What is the key difference between the two?
6 What are the differences between list and tuple?
7 What is List? What are the uses of a List in Python and write
characteristics of a List.
8 Explain String built-in functions in Python.
9 Write down the properties of a dictionary in Python. (repeated 2 times)
10 What are Collections in Python?
11 Define Tuple and how is it created in Python?
12 Explain Nested Tuple with example. (repeated 2 times)
● Programming Questions
13 Write a program that finds maximum and minimum numbers from a
list. (repeated 2 times)
14 Write a program to concatenate two dictionaries into a new one.
(repeated 2 times)
15 Write how to add, remove an element from a set. Explain why POP is
different from remove.
16 List out built-in Dictionary functions. Write a program to demonstrate
dictionary functions and operations.
Unit II: Modules and Packages
Que. Question
No.
1 What are modules and packages in Python?
2 What is Module? Give three examples of Modules.
3 Differentiate between a package and a module in Python.
4 Define PIP.
5 Explain the advantages of the module.
6 Explain the intra-package reference concept in Python.
7 What is random module? Explain with example. (repeated 2 times)
8 Explain different ways of importing a package. Give one example of it.
(repeated 2 times)
9 What is the dir() function in Python? Explain with example. (repeated 2
times)
● Programming Questions
10 Write a program to define a module to find the sum of two numbers.
Import the module into another program. (repeated 2 times)
11 Write a program to define a module to find the area and circumference
of a circle. Import this module in a program and call functions from it.
12 List out the steps to create a user-defined package with a proper
example.
Unit III: Exception Handling
Que. Question
No.
1 What is a Runtime error and Logical error? Explain with example.
(repeated 2 times)
2 What are the built-in exceptions and give their types. (repeated 2 times)
3 Explain Syntax error and how do we identify it? Give an example.
(repeated 2 times)
4 What is Exception handling in Python? Explain with a proper example.
(repeated 2 times)
5 Differentiate errors & exceptions. (repeated 2 times)
6 List any five built-in exceptions in Python. (repeated 2 times)
7 Explain types of errors in Python.
8 Explain the structure of try-except.
9 Write points on Except and explain it. (repeated 2 times)
10 Write points on finally and explain with an example.
11 Explain Raising an Exceptions in Python with example.
● Programming Questions
12 Write a user-defined exception that could be raised when the text
entered by a user consists of less than 10 characters.
13 Write a program to catch a Divide by Zero Exception with a finally
clause. (repeated 2 times)
14 Develop a function for marks result which contains two arguments
(English and Maths marks). If the value of any argument is less than 0,
raise an error.
Unit IV: Files Handling
Que. Question
No.
1 What kind of different operations can we perform in a file? (repeated 2
times)
2 What is file handling? List file handling operations. (repeated 2 times)
3 Give a list of file modes. (repeated 2 times)
4 How to open and close a file? Also give the syntax for the same.
5 What is the difference between a Text file and a Binary file?
6 Explain object serialization. (repeated 2 times)
7 Explain load() method with example. (repeated 2 times)
● Programming Questions
8 Write a program to sort all the words in a file and put them in a list.
(repeated 2 times)
9 Write a program that inputs a text file. The program should print all of
the unique words in the file in alphabetical order. (repeated 2 times)
10 Write a program to count all the vowels in a file.
11 Write a program to create a binary file to store Seat No and Name.
Search any Seat No and display the name if found, otherwise “Seat No
not found”.
Unit V: Graphics with Turtle
Que. Question
No.
1 What is Turtle and how is it used to draw objects? (repeated 2 times)
2 How can we change turtle shape and pen color?
3 Explain the various inbuilt methods to change the direction of the
Turtle. (repeated 2 times)
4 Explain different ways to move the turtle to another position.
5 Explain the use of the following turtle functions with an appropriate
example: turn() and move(). (repeated 2 times)
6 Explain the use of the following turtle functions with an appropriate
example: penup() and pendown().
7 What are the various types of pen commands in Turtle? Explain them
all. (repeated 2 times)
8 Explain the Shape function in Turtle. How many types of shapes are
there in Turtle?
9 Explain how loops can be useful in turtle and provide an example.
● Programming Questions
10 Write a program to draw a square, rectangle, and circle using turtle.
(repeated 2 times)
11 Draw Circle and Triangle shapes using Turtle and fill them with red
color. (repeated 2 times)
12 Write a program to draw a smiling face emoji using turtle.
13 Write a program to draw an Indian Flag using Turtle. (repeated 2 times)
14 Draw circle and star shapes using turtle and fill them with red color.