Python Programming Paper
Subject Code: 24CAT-606
Time: 1 Hours | Max Marks: 20
Section A
(5 × 2 = 10 Marks)
- Enumerate four reasons why Python is popular for programming. (CO1)
- Explain the purpose and usage of nested loops in Python. Provide an example demonstrating nested loop usage. (CO1)
- Outline the concept of dictionary comprehension in Python. (CO2)
- Demonstrate the purpose of the return statement in a function and explain with the help of example. (CO2)
- State the purpose and usage of the
map()
function in Python. (CO2)
Section B
(2 × 5 = 10 Marks)
- Analyze a Python program that prompts the user to enter a sentence and counts the number of vowels in it. Display the result as output. (CO3)
- Describe if, if-else, and switch statements in Python. Compare and contrast their functionalities with examples. (CO1)