A programmer needs to write a function that takes a list of numbers as input and returns the average value multiplied by 2.
He has several variants for the algorithm:
Algorithm A:
- calculate the mean value
- multiply the mean value by 2
- print the result
Algorithm B:
- calculate the mean value
- multiply the mean value by 2
- return the result
Algorithm C:
- calculate the mean value
- print the result
- return the result
Algorithm D:
- multiply the mean value by 2
- calculate the mean value
- print the result
Choose the right variant.