Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def inputData():
- x = int(input("Enter X: "))
- y = int(input("Enter Y: "))
- return {
- "x": x,
- "y": y,
- }
- def compute(xy):
- x = xy["x"]
- y = xy["y"]
- total = 1
- for i in range(y):
- total *= x
- return total
- def myfactorial(n1):
- result = 1
- while n1 > 1:
- result *= n1
- n1 -= 1
- return result
- def solveA(xy):
- x = compute(xy)
- n2 = myfactorial(xy["y"])
- return round(x/n2, 4)
- if __name__ == "__main__":
- xy = inputData()
- a = solveA(xy)
- print(a)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement