0% found this document useful (0 votes)
22 views

Python Final Exam - ODL December2023

This document contains instructions and questions for a Python programming exam. It is divided into 3 sections - Section A contains 10 multiple choice questions worth 20 marks total. Section B contains 5 short answer questions worth 30 marks total. The exam is worth a total of 50 marks and lasts 3 hours. Students must write their answers in the provided booklet, showing all working and using appropriate units.

Uploaded by

Tonny
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

Python Final Exam - ODL December2023

This document contains instructions and questions for a Python programming exam. It is divided into 3 sections - Section A contains 10 multiple choice questions worth 20 marks total. Section B contains 5 short answer questions worth 30 marks total. The exam is worth a total of 50 marks and lasts 3 hours. Students must write their answers in the provided booklet, showing all working and using appropriate units.

Uploaded by

Tonny
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

*8997913024*

PROGRAMMING IN PYTHON DCS1


December 2023
3 hours

You must answer on the provided answer


booklet.
You will need:

INSTRUCTIONS

● There are three sections in this paper,


● Answer ALL questions from Section A.
● Answer ALL questions from Section B.
● Use a black or dark blue pen. You may use an HB pencil for any diagrams or graphs.
● Write your names, programme and student number on every page of the answer booklet.
● Write your answer to each question in the space provided.
● Do not use an erasable pen or correction fluid.
● Do not write on any bar codes.
● You should show all your working and use appropriate units.

INFORMATION
● The total mark for this paper is 50.
● The number of marks for each question or part question is shown in brackets [ ].

This document has 3 pages. Blank pages are indicated.

© PRI 2023 [Turn over]

SECTION (A)
20 marks, Answer all

1. Python is a ___object-oriented programming language.

A. Special purpose B. General purpose

C. Medium level programming language D. All of the mentioned above

2. Amongst which of the following is / are the application areas of Python

programming?

A. Web Development B. Game Development

C. Artificial Intelligence and Machine Learning D. All of the mentioned above

3. Float type of data type is represented by the float class.

A. True B. False

4. The % operator returns the ___.

A. Quotient B. Divisor

C. Remainder D. None of the mentioned above

5. What will be the output of the following Python code?

a=7
if a>4: print("Greater")

A. Greater B. 7 C. 4 D. Lesser

6. What will be the output of the following Python code?


i=5
if i>11 : print ("i is greater than 11")
A. No output
B. Abnormal termination of program
C. Both A and B
D. None of the mentioned above
7. The for loop in Python is used to ___ over a sequence or other iterable objects.
A. Jump B. Iterate
C. Switch D. All of the mentioned above
8. The continue keyword is used to ___ the current iteration in a loop.
A. Initiate B. Start
C. End D. None of the mentioned above
9. Amongst which of the following is / are true about the while loop?
A. It continually executes the statements as long as the given condition is true
B. It first checks the condition and then jumps into the instructions
C. The loop stops running when the condition becomes fail, and control will move to the
next line of code.
D. All the mentioned above
10. Computer can execute the code in .
A. machine language B. assembly language C. python language D. high-level language

SECTION B
Answer All Questions.
1. Write A beginning Python line comment. [6 Marks]
2. What is a Python paragraph comment used? [6 Marks]
3. Write any Two valid identifiers. [6 Marks]
4. What will be displayed by the following code? [6 Marks]
x=1
x=2*x+1
print(x)

x, y = 1, 2
print(y, x)
5. What is the result of 45 / 4? [6 Marks]

You might also like