Problem 2: Add Bonus Marks Using Vectorization
Easypython
Problem Description
Write a Python program that takes an array of student marks and adds a fixed bonus (given as input) to every mark using a single vectorized operation (no loop allowed).
Input
A list of marks, and a bonus value.
Output
The updated array with bonus marks added to every value.
Constraints
- Bonus will be a positive integer.
Example Input
textmarks = [60, 75, 82], bonus = 5
Example Output
textUpdated Marks: [65 80 87]
Concepts Covered
NumPy arrays, vectorized addition, broadcasting.