Certainly! Here's an example of a programming quiz question worth 10 marks. This question is focused on Python programming:
Question:
Consider a list of integers:
pythonnumbers = [4, 7, 1, 9, 3, 5, 2, 8, 6]
Write a Python program to accomplish the following tasks:
- Find and print the maximum value in the list.
- Calculate and print the sum of all even numbers in the list.
- Create a new list containing the square of each number in the original list.
- Sort the original list in descending order.
- Implement a function
is_prime(num)that takes an integernumas an argument and returnsTrueif the number is prime andFalseotherwise.