April / May 2024
Problem Solving and Python Programming
Anna University
1 question papers available. Select an examination session to view its question paper.
Problem Solving and Python Programming
Based on available extracted papers. Question groups and frequency are provisional, not official syllabus weightage or examination predictions.
Differentiate between compiler and interpreter. 2 1 2
0 eligible source papersEvaluate the following expressions in python: 24//6%3 . 2 1 4
0 eligible source papersFind the output for the following code: 2 2 5 for i in range(10): if not i%2==0: print(i+1)
0 eligible source papersHighlight the use of break statement with an example. 2 2 1 9 What is difference between list and tuple in python? 2 3 2
0 eligible source papersGive a function that can take a value and return the first key 2 3 1 Cc mapping to that value in a dictionary.
0 eligible source papersDefine recursion with an example. 2 4 1
0 eligible source papersIllustrate the use of “*” and “+" in strings with an example. 2 4 2
0 eligible source papersDistinguish between files and modules. 2 5 2
0 eligible source papersWrite a python program that counts the number of words in a file. 2 5 3 PART- 8 (5x 13=65Marks)
0 eligible source papers(a)(i)| Briefly describe the various types of operators in phyton with 6 1 1 necessary examples. (1)) Draw the flowchart and write the python code to accept a 5 digit 7 1 3 integer as input and generate a 2 digit integer by repeatedly , summing the individual digits of the 5 digit input integer. (Example: Input = 99999 & Output = 45).
0 eligible source papers(b) (i) | Draw the flowchart and write the algorithm and python code to 7 1 3 read the address of a user, and display the result by breaking into multiple lines. (ii) Draw the flowchart and write the python program for swapping two numbers without using temporary storage.
0 eligible source papers(a) Consider the stand four quadrant system. Based on the input from the user(x,y) , write a phyton program with the necessary algorithm and flowchart to identify the respective quadrant of the user defined point (x,y). 13
0 eligible source papers(b) Draw the flowchart and write the algorithm and Python program to print the following Pattern:
0 eligible source papers(a)(i) Write a python program to rotate a list by right n times with and without slicing technique. (ii) Write a python program print the maximum among ‘n’ randomly generate ‘d’ numbers by storing them in a list.
0 eligible source papers(b)(i) Appraise the operations for dynamically manipulating dictionaries. Substantiate with necessary examples. 13
0 eligible source papers(a) Draw the flowchart and write the algorithm and Python program to check if the input IFSC code is valid or not for banking applications. (Conditions: First 4 elements must be alphabets, next 3 elements must be zeros and last 4 elements need to be non-zero numbers, total string length must be 11) 13
0 eligible source papers(b)(i) What are modules in python? How will you import them? Explain the concept by creating and importing a module. (ii) Briefly describe any four string operations with valid examples.
0 eligible source papers(a) Describe how exceptions are handled in python with necessary examples. 13
0 eligible source papers(b) (i) Draw the flowchart and write the python code to print all numbers present in the text file and also print the number of block spaces in that file. (ii) How to merge multiple files in to a new using python?
0 eligible source papers(i) Write a function find index (), which returns the index of a number in the Fibonacci sequence, if the number is an element of this sequence. It should also generate an error message if the number is not contained in it, call this function using user input. (ii) Write Pythonic code to create a function called most_frequent that takes a string and prints the letters in decreasing order of frequency using dictionaries.
1 eligible source papersHistorical analysis based on extracted question papers. Topic classifications, marks and planning estimates are provisional.