PYTHON
QUESTION_BANK UNIT-1 & 2
SEC-A
1. In some languages, every statement ends with a semi-colon (;). What happens if you put a semi-colon
at the end of a Python statement?
2. Mention five benefits of using Python.
3. How is Python an interpreted language?
4. What type of language is python?
5. What are local variables and global variables in Python?
6. Define floor division with example.
7. Explain the Programming Cycle for Python in detail.
8. What do you mean by Python IDE? Explain in detail.
9. Describe the concept of List Slicing with a suitable example.
10. What is object-oriented programming (OOP) in Python? Give an example.
11. Differentiate between / and // operator with an example
12. Describe the behavior of "range (s, e)" in Python.
SEC-B
1. Discuss function in python with its parts and scope. Explain with example. (Take Simple calculator
with add, subtract, Division and Multiplication).
2. Develop a program to calculate the reverse of any entered number.
3. Define Membership and Identity Operators.
Given: a = 3 b = 3
Distinguish between: (a is b) and (a = = b)?
SEC-C
1. Write short notes with example: Elements of Python, and Boolean Expression.
2. How memory is managed in Python? Explain PEP 8. Write a Python program to print even length
words in a string.
3. Explain Expression Evaluation & Float Representation with example. Write a Python Program for How
to check if a given number is Fibonacci number.
4. Explain why python is considered an interpreted language.
5. Write a program to produce Fibonacci series in Python.
6. Illustrate different list slicing constructs for the following operations on the following
list: L = [1, 2, 3, 4, 5, 6, 7, 8, 9]
1. Return a list of numbers starting from the last to second item of the list
2. Return a list that start from 3rd item to second last item.
3. Return a list that has only even position elements of list L to list M.
4. Return a list that starts from the middle of the list L.
5. Return a list that reverses all the elements starting from element at index 0 to middle index
only and return the entire list.
Divide each element of the list by 2 and replace it with the remainder
7. Explore the working of while, and for loop with examples.
8. Write short notes on the following with examples:
a) Operator Precedence b) Python Indentation c) Type Conversion
9. Explain the why loops are needed and the types of loops in python. Discuss break and continue with
example. Write a Python program to convert time from 12 hour to 24-hour format.
10. Discuss various categories of operators in Python. Find and explain stepwise solution of following
expressions if a = 3, b =5. c=10:
I. a&b<< 2//5**2 + c^b
II. b >> a**2 << 2 >> b**2^c**3
11. Discuss why Python is interpreted language. Explain history and features of python while comparing
Python version 2 and 3.