Question 1
Q1-numbers = [1, 2, 3, 4, 5]
squares = list(map(lambda x: x**2, numbers))
What does the squares list contain after executing the code?
Question 2
Q2-words = ["apple", "banana", "cherry"]
filtered_words = list(filter(lambda x: len(x) > 5, words))
What is the value of filtered_words after executing the code?
Question 3
Q3-nums1 = [1, 2, 3]
nums2 = [4, 5, 6]
result = list(zip(nums1, nums2))
What is the value of result after executing the code?
Question 4
Q4-numbers = [1, 2, 3, 4, 5]
squared_odd = list(map(lambda x: x**2, filter(lambda x: x % 2 != 0, numbers)))
What does the squared_odd list contain after executing the code?
Question 5
Q5-numbers = [1, 2, 3, 4, 5]
product = lambda x, y: x * y
result = reduce(product, numbers)
What is the value of result after executing the code?
Question 7
Q7-char = 'A'
ascii_value = ord(char)
What is the value of ascii_value after executing the code?
Question 8
Q8-code_point = 97
character = chr(code_point)
What is the value of character after executing the code?
Question 9
Q9-text = "Python"
ascii_values = [ord(char) for char in text]
What is the value of ascii_values after executing the code?
There are 10 questions to complete.