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

BANGALORE INSTITUTE OF TECHNOLOGY

K R ROAD, V V PURA, BANGALURU-04


DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
I Internals –Online-2020-21(odd)
BATCH: 2018
COURSE (CODE): 18CS55 SEM: 5th
DATE & TIME: 7/10/2020 & 9.30 am to 11.30 am MAX MARKS: 30+10

USN:
Note: Answer any one full question from each part
Part-A Blooms
Q.No. Marks CO’s PO’s
Levels

1. a) Explain the following functions with examples:- 10


1 1 2
(i)input (ii) print() (iii) int() (iv) float() (v) str()

b) Illustrate An Annoying While loop with example. 5


1 2 2
OR

Classify and Discuss the different conditional statements in


10 1 2 2
2. a) python.

Explain the syntax of Functions with example in python.


b) 5
1 1 2

Part-B
2
Interpret the Local and Global Scope in python.
3. a) 10 2
Illustrate Exception Handling for Arithmetic Exception in 1
b) 2
python.
5 2
OR 1
1
Explain the for loop and range() function. Describe the 1
4. a) 10 2
Starting, Stopping and Stepping Argument to range() in
python. 1
b) 5 2 2
Write a Python program to “Guess the Number”.

CO1:Apply the python programming language syntax and semantics for writing programs to a problem
definition.

L’s:L2-Apply

Faculty-Incharge

Course Co-ordinator Module Co-ordinator IQAC Programme Co-ordinator


QUIZ

1. In Python 3, what is the type of type(range(5))


a) float b) range c) None d) int

2. What is the output of print(2 * 3 ** 3 * 4)


a) 261 b) 216 c)864 d) 846

3. In Python3, which functions are used to accept input from the user
a) raw_input() b) rawinput() c) input() d)string()

4. In Python3, Whatever you enter as input, the input() function converts it into a string
a) True b)False

5. Select which is true for Python function


a) A Python function can return only a single value
b) A function can take an unlimited number of arguments.
c) A Python function can return multiple values
d) Python function doesn’t return anything unless and until you add a return statement
(i) a and c (ii)a and b (iii)b and c (iv)b and d

6. What is the data type of print(type(10))


a) int b)float c)str d)None.

7. What is the output of the following code


def fun1():
x = 50
return x
fun1()
print(x)

a)50 b)Name Error c)Value Error d)None

8. if -3 will evaluate to
a) True b) False

9. What is the output of the following range() function


fornum in range(2,-5,-1):
print(num, end = ” , ”)
a) 2,1,0 b) 2,1,0,-1,-2,-3,-4,-5 c)2,1,0,-1,-2,-3,-4 d) None

10. What is the output of the following function call


def fun(num):
return num + 25
fun(5)
(num)
a) 25 b) 5 c)NameError d) None

Faculty-Incharge

Course Co-ordinator Module Co-ordinator IQAC Programme Co-ordinator

You might also like