Source code documentation

Examples module

Module with exercises for the workshop

Examples module API

BestPracticesWorkshop.examples.odd(num)[source]

Return the closest odd number to n

Parameters:n – An integer
Returns:The same integer if it is odd. The next integer otherwise
Return type:int
Raises ValueError:
 If the parameter is not inteer
BestPracticesWorkshop.examples.sum_list(lst)[source]

Sum all elements in list

Parameters:l – List containing elements to sum
Returns:The sum of all elements in the list
Return type:int
Raises ValueError:
 If there is any non-integer element on the list