Python Quick Quiz

Hey Learners,
Take a moment to solve the quiz questions provided, carefully considering each option before making your selection. The journey of solving these questions will not only expand your understanding but also ignite your curiosity to explore more.
Wishing you the best of luck! May this quiz be a rewarding experience that enhances your Python skills and fuels your passion for programming.

  1. What is the output of the following code?
    x = 10
    y = 3
    result = x / y
    print(result)

a) 3.3333333333333335
b) 3.33
c) 3
d) 3.0

  1. What will be the value of result after executing the code?

result = lambda x: x * 2
print(result(5))

a) 5
b) 10
c) 25
d) 20

  1. What is the output of the following code?

x = [1, 2, 3, 4, 5]
y = [num * 2 for num in x if num % 2 == 0]
print(y)

a) [2, 4, 6, 8, 10]
b) [2, 4]
c) [1, 2, 3, 4, 5]
d) [4, 8]

2 Likes

Q1.) Ans: a) 3.3333333333333335
Q2.) Ans: b) 10
Q3.) Ans: d) [4, 8]

1 Like

Answers

  1. a)
  2. b)
  3. d)
1 Like
  1. 3.3333333333333335
  2. 10
  3. [4, 8]
1 Like