How It WorksPricing🔥Interactive Engineering Learning🤩 Free Career AdviceAboutContact
Log In
Add to Slack

Python Magic Quiz

Test your knowledge of Python by answering this quiz!
Question 1 of 1

Given the following Python code, explain what it is doing.

import math

nums = [1, 4, 5, 6, 7, 10, 14, 42]
new_nums = list(filter(lambda n: n % 2 != 0, nums))

print(sorted(new_nums)[math.floor(len(new_nums) / 2)])


  • Given a list, only take numbers divisible by two and return the average of the resulting set.
  • Given a list, only take numbers not divisible by two and return the average of the resulting set.
  • Given a list, only take numbers not divisible by two and return the median of the resulting set.
  • Given a list, only take numbers divisible by two and return the median of the resulting set.
How do you stack up?
My Progress
Percentage of Total Answers Correct
0 / 0
0%

Breakdown by Tag
code-analysis
0 / 0
0%
0 / 0
0%
SkillMagic

How It Works