ANNA UNIVERSITY · REGULATION 2021
Important Questions
GE 3151 — PROBLEM SOLVING AND PYTHON PROGRAMMING
First Semester · Civil Engineering
Prepared from 6 previous year question papers (Apr/May 2024, Nov/Dec 2023, Apr/May 2023, Nov/Dec 2022, Nov/Dec 2022, Apr/May 2022). Every question was compared with the others of its unit; the ones asked more than once come first. "Most asked topics" shows in how many different exams a syllabus topic had a question.
UNIT 1Computational Thinking and Problem Solving
Most asked topics: Algorithms (6/6) · Towers of Hanoi (5/6) · guess an integer number in a range (1/6)
Part A · 2 marks
- 1.What are the simple strategies for developing algorithms?(2)
Asked 2 times: Nov/Dec 2023, Apr/May 2023
- 2.Differentiate Algorithm and Pseudo code.(2)
Asked in Apr/May 2024
- 3.Write any two disadvantages of flowchart?(2)
Asked in Apr/May 2024
- 4.What is Algorithm?(2)
Asked in Nov/Dec 2023
- 5.State the qualities of a good algorithm.(2)
Asked in Apr/May 2023
- 6.How does flow of control work?(2)
Asked in Nov/Dec 2022
Part B · 16 marks
- 1.(i) Explain the steps involved in program development cycle. (ii) Write the algorithm, pseudocode and draw the flowchart for the following : (1) Guess an integer number in a range. (4) (2) Towers of Hanoi. (4)(16)
Asked in Apr/May 2024
- 2.(i) Explain the design structures in pseudo code. (ii) Write the algorithm, pseudocode and draw the flowchart for the following : (1) To find the sum of square root of any three numbers. (4) (2) To find the sum of first 100 integers. (4)(16)
Asked in Apr/May 2024
- 3.(i) What are the building blocks of algorithm, explain in detail. (ii) Discuss the various process to the smallest value in the list a = [18, 52, 23, 41, 32] and write a simple python program for the same.(16)
Asked in Nov/Dec 2023
- 4.(i) Explain the logic of the Tower of Hanoi puzzle and write a simple python program for the same and mention the time complexity. (ii) Define the computational problem and how these problems are classified.(16)
Asked in Nov/Dec 2023
UNIT 2Data Types, Expressions, Statements
Most asked topics: variables (3/6) · Python interpreter and interactive mode (2/6) · precedence of operators (2/6) · statements (1/6) · distance between two points (1/6)
Part A · 2 marks
- 1.What is the difference between interactive mode and script mode?(2)
Asked in Apr/May 2024
- 2.Mention the features of lists in python.(2)
Asked in Apr/May 2024
- 3.List the various single valued data types in Python.(2)
Asked in Nov/Dec 2023
- 4.What is an indentation in python? Give an example.(2)
Asked in Nov/Dec 2023
- 5.What are the rules for writing an identifier?(2)
Asked in Apr/May 2023
- 6.Mention the types of arguments in python.(2)
Asked in Apr/May 2023
Part B · 16 marks
- 1.Write the following python programs (i) Test whether a given year is leap year or not (ii) To convert Celsius to Fahrenheit.(16)
Asked in Apr/May 2024
- 2.Write the following python programs (i) To find whether a given number is Armstrong number or not (ii) To print Fibonacci series.(16)
Asked in Apr/May 2024
- 3.(i) Explain the python interpreter and interactive mode in detail. (ii) What operator has the highest precedence in Python?(16)
Asked in Nov/Dec 2023
- 4.(i) Write a python program to calculate the distance between two points. (ii) Explain the different Boolean and bitwise operator types in Python?(16)
Asked in Nov/Dec 2023
UNIT 3Control Flow, Functions, Strings
Most asked topics: linear search (2/6) · binary search (2/6) · conditional (if) (1/6) · parameters (1/6) · immutability (1/6) · string functions and methods (1/6)
Part A · 2 marks
- 1.What is the fruitful function in python?(2)
Asked 2 times: Nov/Dec 2023, Nov/Dec 2022
- 2.What is 'len' function? Give example for how it is used on strings.(2)
Asked in Apr/May 2024
- 3.How to split strings and what function is used to perform that operation?(2)
Asked in Apr/May 2024
- 4.Write a for loop that prints numbers from 0 to 57 using the range function in python.(2)
Asked in Nov/Dec 2023
- 5.Compare return value and composition.(2)
Asked in Apr/May 2023
- 6.Define string immutability.(2)
Asked in Apr/May 2023
Part B · 16 marks
- 1.(i) Explain call by value and call by reference in python. (ii) How to perform a user input in Python? Explain with example.(16)
Asked in Apr/May 2024
- 2.(i) Briefly explain about function prototypes. (ii) Write a program to check whether entered string is palindrome or not.(16)
Asked in Apr/May 2024
- 3.(i) Illustrate the different types of control flow statements in Python with flowcharts. (ii) Explain any two string formats available in Python.(16)
Asked in Nov/Dec 2023
- 4.(i) Discuss the binary search algorithm with time complexity and write a python to implement the same using the recursive method. (ii) Why are strings in Python immutable?(16)
Asked in Nov/Dec 2023
UNIT 4Lists, Tuples, Dictionaries
Most asked topics: Lists: list operations (4/6) · cloning lists (2/6) · list slices (1/6) · list methods (1/6) · Dictionaries: operations and methods (1/6) · Illustrative programs: simple sorting (1/6)
Part A · 2 marks
- 1.What is a tuple in python? Give an example.(2)
Asked 2 times: Nov/Dec 2023, Apr/May 2023
- 2.What is range( ) function and how it is used in lists?(2)
Asked in Apr/May 2024
- 3.What are the advantages of 'Tuple' over 'List'?(2)
Asked in Apr/May 2024
- 4.What are List Comprehension? Mention its advantages.(2)
Asked in Nov/Dec 2023
- 5.Define cloning in list.(2)
Asked in Apr/May 2023
- 6.Relate String and List.(2)
Asked in Nov/Dec 2022
Part B · 16 marks
- 1.What are the basic list operations that can be performed in Python? Explain each operation with its syntax and example.(16)
Asked in Apr/May 2024
- 2.What is Dictionary? Explain Python dictionaries in detail discussing its operations and methods.(16)
Asked in Apr/May 2024
- 3.(i) Discuss the differences and applications of List, Tuple, and Dictionary in Python. (ii) Explain any cloning list technique in python.(16)
Asked in Nov/Dec 2023
- 4.(i) Discuss Python dictionaries and list some of their methods. (ii) Write a simple sorting python program to sort different data types.(16)
Asked in Nov/Dec 2023
UNIT 5Files, Modules, Packages
Most asked topics: modules (3/6) · Illustrative programs: word count (3/6) · format operator (2/6) · command line arguments (2/6) · handling exceptions (2/6) · packages (2/6)
Part A · 2 marks
- 1.What is module and package in Python?(2)
Asked in Apr/May 2024
- 2.List few common exception types.(2)
Asked in Apr/May 2024
- 3.Write the significance of format operator.(2)
Asked in Nov/Dec 2023
- 4.How exceptions are handled in python?(2)
Asked in Nov/Dec 2023
- 5.How do you delete a file in Python?(2)
Asked in Apr/May 2023
- 6.How do you use command line arguments to give input to the program?(2)
Asked in Apr/May 2023
Part B · 16 marks
- 1.Explain in detail about Python Files, its types, functions and operations that can be performed on files with examples.(16)
Asked 2 times: Apr/May 2024, Nov/Dec 2023
- 2.(i) Write a program to enter a number in Python and print its octal and hexadecimal equivalent. (ii) Explain in detail about namespaces and scoping.(16)
Asked in Apr/May 2024
- 3.(i) Write a simple python program to count the number of words in the sentence using the split method and list other count methods. (ii) What are command line arguments in python?(16)
Asked in Nov/Dec 2023
- 4.(i) Write a function that copies a file reading and writing upto 50 characters at a time. (ii) Write a python program to count number of lines, words and characters in a text file.(16)
Asked in Apr/May 2023