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

Python Programming - 29-3-2018

The document is a mid-semester exam for a Python Programming course. It contains questions about Python concepts like variables, strings, operators, and functions. It tests the students on their understanding of Python fundamentals through true/false, multiple choice, and coding questions.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Python Programming - 29-3-2018

The document is a mid-semester exam for a Python Programming course. It contains questions about Python concepts like variables, strings, operators, and functions. It tests the students on their understanding of Python fundamentals through true/false, multiple choice, and coding questions.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Seat No:______________ Enrollment No:______________

PARUL UNIVERSITY
FACULTY OF IT & COMPUTER SCIENCE
Parul Institute of Computer Application
Bachelor of Computer Application
2017–18 Mid Semester Examination
Semester: 2 Date: 29/03/2018
Subject Code: 05101155 Time: 10:00 to 12:00
Subject Name: Python Programming Total Marks: 40
Instructions:
1. Figures to the right indicate full marks.
2. Make suitable assumptions wherever necessary.

Q.1 Answer the following.


(a) Give Answer of following Short Question. [3]
1) Differentiate between Variables and Keywords.
2) What is a string slice? Explain with example.
3) Give a method name which is used to check data type of python variable.
(b) Solve MCQ [7]
1) Which statement is used when you do not want any code to execute?
a) Break b) Go to
c) Pass d) None of above
2) Operators with the same precedence are evaluated in which manner?
a) Left to Right b) Right to Left
3) Which of the following is an invalid statement?
a) abc = 1,000,000 b) a b c = 1000 2000 3000
c) a,b,c = 1000, 2000, 3000 d) a_b_c = 1,000,000
4) Which one of these is floor division?
a) / b) //
c) % d) None of the mentioned
5) Which statement is used to check multiple conditions?
a) If…else…if b) If…
b) If….else d) none of above
6) What is the output when following string statement is executed?
>>>"abcd"[2:]
a) a b) ab
c) cd d) dc

1 of 1
7) What arithmetic operators cannot be used with strings?
a) + b) *
c) ** d) b & c
Q.2 Answer the following.
(a) [4]
1) Explain the use of ‘in’ operator in string giving example.
2) What are Modulus Operator and Boolean Expression? Explain giving example.

(b) [6]
1) What are Complier and Interpreter? Explain interpreter in Detail.
2) Justify the statement “Strings are immutable”.
Q.3 Attempt any TWO.
1 What are Errors? List and explain the different types of errors. [5]
2 List the operators precedence. Solve the following Program using operator precedence. [5]

a = 20, b = 10, c = 15, d = 5, e = 0

e = (a + b) * c / d
print "Value of (a + b) * c / d is ", e

e = ((a + b) * c) / d
print "Value of ((a + b) * c) / d is ", e

e = (a + b) * (c / d);
print "Value of (a + b) * (c / d) is ", e

e = a + (b * c) / d;
print "Value of a + (b * c) / d is ", e

3 What is Chained execution? Write a program to find number is Largest among three number [5]
using Chain Condition.

Q.4 Answer the following.


(a) Write note on recursion. Also write a program to find factorial of numbers using recursion. [5]

(b) What is string? Explain at least 4 methods of string. [5]

OR
(b) What is Alternative Execution? Write Syntax and Draw Flow Charts. [5]

2 of 1

You might also like