0% found this document useful (0 votes)
9 views2 pages

Python Important Questions

The document outlines important Python questions across five modules, covering topics such as control statements, functions, variable scope, exception handling, data structures, file operations, logging, and object-oriented programming. Each module includes specific questions that require explanations and examples, such as the use of lists, tuples, dictionaries, and methods for file handling. The document serves as a comprehensive guide for understanding key Python concepts and practices.

Uploaded by

raninandini2005
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views2 pages

Python Important Questions

The document outlines important Python questions across five modules, covering topics such as control statements, functions, variable scope, exception handling, data structures, file operations, logging, and object-oriented programming. Each module includes specific questions that require explanations and examples, such as the use of lists, tuples, dictionaries, and methods for file handling. The document serves as a comprehensive guide for understanding key Python concepts and practices.

Uploaded by

raninandini2005
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Python Important questions

Module 1
1.​ Explain elif, for , while , break and continue statements in python with examples
for
each and flowchart
2.​ What is a function? How to define a function in python? How can we pass the
parameters to the user defined function explain with an example
3.​ List the rules to define a variable in python? What is local and global scope of
variable in
python Explain the different scenarios with an example snippet.
4.​ How does python handle the exception? Explain with an example program
5.​ Differentiate between parameters and arguments. Illustrate the flow of execution
of a
python function with an example program
6.​ Demonstrate with an example len(), Int(), str() and Range()
7.​ List and explain operators used in python with a suitable example

Module 2
1.​ What are the different methods supported in python List. Illustrate any 3 methods
with
an example.
2.​ Demonstrate the working of tic-tac-toe board using Dictionaries
3.​ [Link] tuples are created in python? Explain the different ways of accessing and
creating
them
4.​ Discuss get(), Item(), values() and keys() dictionary methods in python with
example
for each.
5.​ Explain (i) copy and deep copy() (ii) passing references (iii) list Concatenation
and
replication
6.​ Compare and contrast lists, tuples and dictionaries.

Module 3
1.​ List out all the useful string methods which are supported in python. Explain with
an
example for each method.
2.​ What are the key properties of a file? Explain in detail file reading/writing process
with
an example of python program
3.​ With code snippet, Explain saving variables using the shelve module and print
pfromat() functions
4.​ Write an algorithm to implement password locker functionality
5.​ Develop a program to find total size of all the files in the directory
6.​ Discuss the different paths in the file system
7.​ Explain in briefly, what are the different methods of file operations supports in
python
shutil module.

Module 4
1.​ List and Explain the logging levels in python
2.​ What is meant by compressing files? Explain creating,reading,extracting zip file
with
code snippet
3.​ Explain a role of assertions in python with a suitable example code
4.​ What is the use of ZIP? How to create a Zip folder explain
5.​ Explain the functions with examples: (i) [Link] (ii) [Link]
(iii)[Link]()
6.​ Explain the buttons in of IDLE Debugger window

Module 5
1.​ Define polymorphism. Demonstrate polymorphism with function to find histogram
to count the numbers of times each letter appears in a word and in sentence
2.​ What is type based dispatch? Illustrate with a python program.
3.​ What is a class? How to define a class in python? How to initiate a class and how
the
class members are accessed?
4.​ Explain init and str method with an example python program
5.​ Demonstrate pure function and modifiers with examples.
6.​ Explain operator overloading and polymorphism with examples.
7.​ Write a function called print time that takes a time object and print it in the form
Hour: Minute: Second.

You might also like