C20 CM WD 505 Julyinst 2023

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

WWW.COMPETITORSACADEMY.

IN

7639
C20-CM-WD–505
*
7639
BOARD DIPLOMA EXAMINATION (Inst.), (C-20)
JULY—2023
DCME – FIFTH SEMESTER EXAMINATION
PYTHON PROGRAMMING
Time : 3 hours ] [ Total Marks : 80

PART—A 3×10=30

Instructions : (1) Answer all questions.


(2) Each question carries three marks.
(3) Answers should be brief and straight to the point and shall
not exceed five simple sentences.

1. List any three features of Python programming.

2. Write the syntax for if-elif-else statement in Python.

3. Write a Python program to print numbers from 10 to 50 using while loop.

4. Write the syntax and purpose of return statement in Python.

5. List any three string module functions in Python.

6. List any three basic list operations in Python.

7. List any three dictionary methods in Python.

8. Write the syntax for try, except clauses.

9. Write any three differences between method overloading and method


overriding.
*
10. What is data hiding? List any two advantages of data hiding.
*
/7639 1 [ Contd...
WWW.COMPETITORSACADEMY.IN

PART—B 8×5=40

*
Instructions : (1) Answer all questions.
(2) Each question carries eight marks.
(3) Answers should be comprehensive and criterion for
valuation is the content but not the length of the answer.

11. (a) Explain any four data types of Python with an example.

(OR)

(b) Explain arithmetic operators in Python with a sample program.

12. (a) Write the syntax for for in loop in Python. Write a Python program
to find the prime numbers between the range 10-100.

(OR)

(b) Write the Syntax for if-elif-else statement in Python. Write a


Python program to read weak number and print week day (1-
Monday, 2-Tuesday,..)

13. (a) Explain array methods with simple example.

(OR)

(b) Explain string functions in Python with a sample program.

14. (a) Write a Python program to create a dictionary {1 : 1, 2 : 4, 3 : 9, 4 : 16,


5 : 25} using dictionary comprehension.

(OR)

(b) Explain sets. Write a Python program to read two sets and display
the union of two sets.

15. (a) Write the syntax for opening and closing a file. Write a Python
program to read a file and print first 4 lines of the file.

(OR)
*
(b) Explain Python classes and objects with a sample Python program.
*
/7639 2 [ Contd...
WWW.COMPETITORSACADEMY.IN

PART—C 10×1=10
*
Instructions : (1) Answer the following question.
(2) The question carries ten marks.
(3) Answer should be comprehensive and the criterion for
valuation is the content but not the length of the answer.

16. (a) What is the error in following code? Rewrite the correct code.
weather = ‘raining’
if weather = ‘sunny’:
Print (‘wear sunblock’)
el if weather = ‘snow’:
Print (‘going skiing’)
else :
Print (“None of the above”)

(b) Rewrite the following code fragment using while loop :


for i in range (1,10):
if i%3 == 0:
Print (i)

*
/7639 3 AA23(013)-PDF

You might also like