E1PA103B - Problem Solving and Computer Programming
E1PA103B - Problem Solving and Computer Programming
General Instructions
Answer to the specific question asked
Draw neat, labelled diagrams wherever necessary
Approved data hand books are allowed subject to verification by the Invigilator
1) Do Python tuples and set allow for the modification of their elements K2 (2)
after creation?
2) Write a Python program that uses a for loop to find and display the K1 (3)
sum of all even numbers from 1 to 100 (inclusive).
3) Write a Python program that takes a user's input string and performs K2 (4)
the following tasks: 1. Count the number of characters (including
spaces) in the string. 2. Count the number of words in the string. 3.
Display the input string in reverse order.
4) Write a Python program to find the sum of the first n natural numbers. K2 (6)
Your program should take an integer 'n' as input and output the sum of
the first 'n' natural numbers.
5) Write a program that takes a sentence as input from the user and K3 (6)
computes the frequency of each letter. Use a variable of dictionary
type to maintain the count.
6) Explain the concept of Python lists, including how to access values in K3 (9)
lists, update list elements, and delete list elements, and provide a
program to demonstrate these operations.
7) Mention the different types of iterative structures allowed in Python. K4 (8)
Explain the use of continue and break statements with an example.
OR
"Explain and demonstrate the concept of type conversions in Python K4 (12)
using the int(), float(), and str() functions. Provide three separate
examples, each showcasing the conversion of data from one data
type to another. In each example, include a detailed algorithm, Python
code, and the expected output. Finally, discuss the practical
significance of type conversions in programming."