Python Imp Questions
Python Imp Questions
PYTHON
1. What are local variables and global variables in Python?
2. What is the difference between Python Arrays and lists?
3. Define ADTinterface.
4. Differentiate Fruitful functions and void functions.
5. 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?
6. Discuss ADT in python. How to define ADT? Write code for
student information.
7. Explain the iterator. Write a program to demonstrate the
tower of Hanoi using function.
8. What is Python? How Python is interpreted? What are the tools
that help to find bugs or perform static analysis? What are
Python decorators?
9. Write short notes with example: The Programming Cycle for
Python, Elements of Python.
10. How memory is managed in Python? Explain PEP 8.
11. Explain higher order function with respect to lambda
expression.
12. Explain Unpacking Sequences, Mutable Sequences,
and List Comprehension with example.
13. Discuss File I/O in python.
14. Describe the behavior of “range (s, e)”inPython.
15. Discuss Exceptions and Assertions in python.How to
handle Exceptions with Try-Finally? Explain 5 Built-in
Exceptions with example.
16. Discuss and differentiate Iterators & Recursion.
17. How do you read an input from a user in Python to be used as an
integer in the rest of the program? Explain with an example.
18. Describe the differences between a linear search and a binary
search?
19. Describe the difference between:
import library
And
from library import *
PROGRAMMING QUESTIONS
x[1][1] = 'bye'
a, b = 4,5,6 # s2
19. Write a function makePairs that takes as input two lists of equal
length and returns a single list of same length where k-th element is
the pair of k-th elements from the input lists. For example,
makePairs([1,3,5,7],[2,4,6,8])
returns [(1,2),(3,4),(5,6),(7,8)]
makePairs([],[])
returns []
triangle(3) prints: *
**
***
triangle(5) prints: *
**
***
**** *****
alternating([10, 9, 9, 6])returnsFalse
alternating([10, 15, 8])returnsTrue
alternating([10]) returns True
alternating([]) returns True
alternating([15, 10, 9])returnsFalse