You are on page 1of 2

BEDER INTERNATIONAL UNIVERISITY

Course: Python Mid-Exam (20%)


Part 1: Multiple choice (1 marks each)
1. _______________ is a named block of code executed when called
a) Variable c) Identifier
b) Dictionary d) None
2. In python, The two variables Manpower and manpower are different because
a) Python is programming language
b) Python is case-sensitive
c) Python is case-insensitive
d) Python has no power
3. Python is
a) Interpreted language
b) High level language
c) Used to develop web applications
d) All
4. In python a doc String is represented by ______________
a) Hash (#) c) Double Quotes
b) Single Quote d) Tribble Quotes
5. Tuples are enclosed by curly braces { }
a) True
b) False
6. What Is the maximum length of python identifier __________________
a) 32
b) 16
c) 128
d) No fixed limit is specified
7. What will be the datatype of the var in the code below
var = 10
print(type(var))
var = "Hello"
print (type(var))
a) str and int c) str and str
b) int and int d) int and str
8. Which of the following is logical Operator
a) AND c) NEITHER
b) BUT d) NONE
Part 2: Direct questions and problem solving
1. What is variable? [ 2 Mark ]
………………………………………………………………………………………
………………………………………………………………………………………
……………………………………………………………………………………..
2. Write a program that prints your name [ 2 marks ]
………………………………………………………………………………………
…………………………………………….………………………………………
………………………………..……………………………………………………
3. Write a python program that takes number as input and prints its square? [3 marks]
………………………………………………………………………………………
………………………………………………………………………………………
……………………….……………………………………………………………
………………………………………………………………………………………
……………………………………………….……………………………………
………………………………………………………………………………………
……….……………………………………………………………………………
………………………………………………………….…………………………
……………………………………………………………………………………
4. Write a python program that calculates area of rectangle when length and width
are both taken as input? [ 3 marks ]
………………………………………………………………………………………
………………………………………………………………………………………
……………………….……………………………………………………………
………………………………………………………………………….…………
………………………………………………………………………………………
………………………………………………………………………………………
……………………………………………………………………….……………
………………………………………………………………………………………
………………………
5. What is the difference between list and tuple in python [2 marks]
………………………………………………………………………………………
………………………………………………………………………………………
………………………………………………………………………………………
…………………………………………………………………….………………
………………………………………………………………………………………

END

You might also like