Skip to content

// Anna University, Chennai / 2019

Anna University — Problem Solving and Python Programming (GE8151), December/January 2019

Problem Solving and Python Programming · GE8151 · R2017 · B.E./B.Tech. Engineering (common paper) · Semester 1

Files open in a new tab. Use your browser's download or save option to keep a copy.

Work through the questions

15 questions

No verified answers are available for this paper.

  1. Question 1

    Part AUnit 1Descriptive2 marks

    Python

    Distinguish between an algorithm and a program.

    No verified answer or solution is available for this question.

  2. Question 2

    Part AUnit 1Descriptive2 marks

    Python

    Write an algorithm to find the minimum number in a given list of numbers.

    No verified answer or solution is available for this question.

  3. Question 3

    Part AUnit 2Descriptive2 marks

    Python

    What are keywords? Give examples.

    No verified answer or solution is available for this question.

  4. Question 4

    Part AUnits 2, 3Descriptive2 marks

    Python

    State the reasons to divide programs into functions.

    No verified answer or solution is available for this question.

  5. Question 5

    Part AUnit 3Descriptive2 marks

    Python

    Present the flow of execution for a while statement.

    No verified answer or solution is available for this question.

  6. Question 6

    Part AUnits 1, 3Descriptive2 marks

    Python

    Define recursion with an example.

    No verified answer or solution is available for this question.

  7. Question 7

    Part AUnits 3, 4Descriptive2 marks

    Python

    Relate strings and lists.

    No verified answer or solution is available for this question.

  8. Question 8

    Part AUnit 4Descriptive2 marks

    Python

    Give a function that takes a value and returns the first key mapping to that value in a dictionary.

    No verified answer or solution is available for this question.

  9. Question 9

    Part AUnit 5Descriptive2 marks

    Python

    What is a module? Give an example.

    No verified answer or solution is available for this question.

  10. Question 10

    Part AUnits 3, 5Descriptive2 marks

    Python

    Find the syntax error in the code given: while True print ('Hello world')

    No verified answer or solution is available for this question.

  11. Question 11

    Part BUnit 1Descriptive16 marks

    Python

    (a) (i) Discuss the building blocks of algorithms. (8 marks) (ii) Write a recursive algorithm to solve the Towers of Hanoi problem. (8 marks) (OR) (b) (i) Identify the simple strategies for developing an algorithm. (8 marks) (ii) Write an algorithm to insert a card into a list of sorted cards. (8 marks)

    No verified answer or solution is available for this question.

  12. Question 12

    Part BUnits 2, 3Descriptive16 marks

    Python

    (a) (i) Sketch the structures of an interpreter and compiler, detail the differences, and explain how Python works in interactive mode and script mode with examples. (2 + 2 + 4 marks) (ii) Summarize the precedence of mathematical operators in Python. (8 marks) (OR) (b) (i) Explain the syntax and structure of user-defined functions in Python with examples. Also discuss parameter passing in functions. (12 marks) (ii) Write a Python function to swap the values of two variables. (4 marks)

    No verified answer or solution is available for this question.

  13. Question 13

    Part BUnit 3Descriptive16 marks

    Python

    (a) List the three types of conditional statements and explain them. (16 marks) (OR) (b) (i) Python strings are immutable. Justify with an example. (8 marks) (ii) Write Python code to perform binary search. Trace it with an example of your choice. (8 marks)

    No verified answer or solution is available for this question.

  14. Question 14

    Part BUnit 4Descriptive16 marks

    Python

    (a) (i) Discuss the different options to traverse a list. (8 marks) (ii) Demonstrate the working of +, * and slice operators in Python. (8 marks) (OR) (b) (i) Compare and contrast tuples and lists in Python. (4 marks) (ii) Write a Python script to sort n numbers using selection sort. (12 marks)

    No verified answer or solution is available for this question.

  15. Question 15

    Part BUnit 5Descriptive16 marks

    Python

    (a) (i) Explain the commands used to read and write into a file with examples. (8 marks) (ii) Discuss the use of the format operator in file processing. (8 marks) (OR) (b) Describe how exceptions are handled in Python with examples. (16 marks)

    No verified answer or solution is available for this question.

Keep preparing

Revisit another year or explore a different paper in the library.

More from this exam