เริ่มต้นใช้งานเริ่มต้นใช้งานได้ฟรี

The filter() function

Let's do some filtering! You will be given three corresponding tasks you have to complete. Use lambda expressions! And remember: the filter() function keeps all the elements that are mapped to the True value.

The variables nums, string and spells are available in your workspace.

แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร

Practicing Coding Interview Questions in Python

ดูคอร์ส

แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ

ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์

# Exclude all the numbers from nums divisible by 3 or 5
print(nums)
fnums = filter(____)
print(list(fnums))
แก้ไขและรันโค้ด