codemaniacstudio

Write a Python program to find power of any number x ^ y.

Write a Python program to find power of any number x ^ y.

PROGRAM

# Python program to find power of any number (x ^ y)
# Input from the user
x = float(input(“Enter the base number (x): “))
y = float(input(“Enter the exponent (y): “))
# Calculate power
result = x ** y
# Display the result
print(f”{x} raised to the power {y} is: {result}”)

OUTPUT

TRY THE ABOVE CODE

Exit mobile version