All problems
Laplace Transform of Power
Problem
Return the Laplace transform of f(t) = t^n evaluated at s:
F(s) = n! / s^(n+1)
for integer n >= 0 and s > 0.
Hint
Build n! with a loop, then divide by s raised to n + 1.
Test cases
case 1
in: [0,1]
expected: 1
case 2
in: [1,1]
expected: 1
case 3
in: [2,1]
expected: 2
case 4
in: [3,2]
expected: 0.375
case 5
in: [4,0.5]
expected: 768
Starter codePython
def laplace_power(n, s):
# Your code here
pass5 test cases · run your code against them in the editor