Python Test
Python Test
3. List1 = [1, 2, 3]
list2 = [2, 4]
b = [1, 3, 4, 6, 7, 10]
st = "Python tutorial"
sliceportion = slice(0, 4)
print(b[sliceportion])
print(st[sliceportion])
a = " ".join(a)
print(a)
7. Replace “_” from all the items in the list with “-” and print
the list.
A = [3, 2, 1]
numbers = [1, 2, 3, 4, 5, 6]
list(filter(lambda x: x % 2, numbers))
print(num1/num2)
division(16,4)
division(16)
# Theory Questions
2. What is pep 8?
3. What are decorators in Python?
4. What is the difference between .py and .pyc files?
5. Is python case sensitive?
8. What is __init__?
15. What does this mean: *args, **kwargs? And why would we use it?