MCPcopy Index your code
hub / github.com/LinkedInLearning/learning-python-2896241 / power

Function power

Ch2 - Basics/functions_finished.py:20–24  ·  view source on GitHub ↗
(num, x=1)

Source from the content-addressed store, hash-verified

18
19# function with default value for an argument
20def power(num, x=1):
21 result = 1
22 for i in range(x):
23 result = result * num
24 return result
25
26# function with variable number of arguments
27def multi_add(*args):

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected