|
|
1. Python is... (multiple answers ok)
|
|
|
|
|
|
* [ ] a system programming language
|
|
|
* [ ] a compiled language
|
|
|
* [ ] strongly typed
|
|
|
* [ ] dynamically typed
|
|
|
* [ ] object-oriented
|
|
|
|
|
|
2. write a function to calculate the sum of first 'n' integers
|
|
|
|
|
|
3. Using list comprehension, write a function that displays first 'n' integers divisible by 7
|
|
|
|
|
|
4. what is a generator ?
|
|
|
|
|
|
5. write a context manager to calculate the clock-wall time taken by a code block
|
|
|
|
|
|
6. write a class to represent a shutter, ie. something that can be 'opened' or 'closed'
|
|
|
|
|
|
7. Tell 3 differences between Python 2 and Python 3
|
|
|
|
|
|
8. What are the first 4 results printed by this code:
|
|
|
|
|
|
|
|
|
|
|
|
9.
|
|
|
|
|
|
10.
|
|
|
|