LearnPy Hub
← Exceptions problems
Hard

Assertions

Write average(nums) that asserts the list is not empty (assert nums, 'empty list'). Read a line of integers (possibly just the word none for an empty list) and print the average (2 decimals) or AssertionError: empty list.

Input

One line.

Output

One line.

Sample 1

Input
1 2 3
Output
2.00

Sample 2

Input
none
Output
AssertionError: empty list
solution.py
Output appears here
Assertions · Python practice problem · LearnPy Hub