Use any() to check if any number in [2, 4, 6, 7, 8] is odd
A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- medium
Problem
Use any() to check if any number in [2, 4, 6, 7, 8] is odd. Then use all() to check if all numbers in [2, 4, 6, 8] are even. Print both results.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and grades it automatically.