Python Programming
Assignment 4
Note: 1) The submission date for this assignment is 25/04/2026.
2) This assignment is to be written on A4 sheets only.
3) Please try to write the answers to subjective questions in your own words.
1) What is operator precedence? Why is it important while evaluating complex expressions?
2) Explain the significance of indentation in Python and how is it different from other languages?
3) Define loops. Compare the various types of loops. Explain the difference between iterating
over elements vs iterating using indices with examples.
4) Explain about unconditional looping statements with relevant examples.
5) Explain the concept of parameter passing in Python functions (positional, keyword, default,
and variable-length arguments).
6) Discuss the importance of closing a file properly. What happens if a file is not closed after
performing write operations?
7) Explain the working of the seek() and tell() methods in Python. Provide a scenario where
manipulating the file pointer is useful.
8) Describe any 5 widgets in Tkinter.
9) Describe any 5 methods of the NumPy library.
10) Describe any 5 types of Matplotlib library.