Power calculation function
Write a function that receives 2 numbers as parameter (A and B) and get A to power B and return
Write a function that receives 2 numbers as parameter (A and B) and get A to power B and return
let msg = 'error' alert(msg)This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error' alert(msg)This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error' alert(msg)This answer is only visible to premium members
This answer is only visible to premium members
class Math: def __init__(self, numer1,number2): self.number1=number1 self.number2=number2 def Soulotion(self): return self.number1**number2 number1=int(input("enter your number1:")) number2=int(input("enter your number2:")) obj=Math(number1,number2) print(obj.Soulotion())
def tavan(a , b):
tavan = a**b
print(tavan)
num = float(input("Enter a number:"))
tawan = float(input("Enter tawan:"))
tavan(num , tawan)
def power(a, b):
t = 1
for i in range(b):
t *= a
return t
print(power(2, 4))
def tavan(a,b): return a ** b num1 = int(input('number 1 : ')) num2 = int(input('number 2 : ')) print(tavan(num1,num2))
a=int(input("enter your number:")) b=int(input("enter your number:")) x=(a**b) x=str(x) print('a power b =' + " " + x)
def power(a, b): return a ** b # Calculate A to power b # Example to use the function try: a = float(input("عدد a را وارد کنید: ")) b = int(input("عدد b را وارد کنید: ")) result = power(a, b) print(f"{a} به توان {b} برابر است با: {result}") except ValueError: print("لطفاً یک عدد صحیح برای b و یک عدد برای a وارد کنید.")
def exponentiation():
num1 = float (input ('Enter the number1: '))
num2 = float (input ('Enter the number2: '))
power = num1 ** num2
return power
exponentiation()
Submitting answers is currently unavailable.
Write a function that receives two numbers with one operator (+ - / *) and performs the relevant calculation and returns the result example: CAL (2, '+', 6) #8 CAL (5, ' -' - ' - 1) #4 Cal (' 6, ' /', 2) #3 Cal (8, ' *', 2) #16
Using JavaScript Send a request with the following specifications method = posturl = /test.php FNAME information =? LNAME =? Age =? Get the information above through Prompt from the user
Write a program that receives the square side length from the input and calculates its area of square area = a side of its own = a side of a power 2.
Write a program that receives the age of father and son from the input and prints them (subtraction) in the output
You must be logged in to access this section.
Login/Sign up If you don’t understand the exercise or can’t solve it for any reason, that’s completely
normal—don’t worry 😊
Try checking out easier exercises and reviewing different answers
submitted by others. Gradually, you can move on to more challenging exercises. Also, your answer
might be correct even if it’s different from others.