CodeSolved

Solved Programming Questions & Exercises

Power calculation function

Practice Easy 8/ Download 2582 Views

Write a function that receives 2 numbers as parameter (A and B) and get A to power B and return

21 Answers

This answer is only visible to premium members
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

This answer is only visible to premium members

Subscription is currently unavailable.
This answer is only visible to premium members
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

This answer is only visible to premium members

Subscription is currently unavailable.
This answer is only visible to premium members
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

This answer is only visible to premium members

Subscription is currently unavailable.
a = int(input("a: "))
b = int(input("b: "))
m = b ** a
print(m)
User 5396 Download Python
def tavan(a,b):
    return a**b
print(tavan(a=int(input("enter your number:")),b=int(input("entre your number:"))))
Sumy.amiri Download Python
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())
Roghaye.m Download Python
def power(a, b):
    return a ** b
Ai Download Python
def tavan(a , b):
    tavan = a**b
    print(tavan)

num = float(input("Enter a number:"))
tawan = float(input("Enter tawan:"))

tavan(num , tawan)

User 3382 Download Python
def power(a, b):
    t = 1
    for i in range(b):
        t *= a
    return t
print(power(2, 4))
User 720 Download Python
def tavan(a,b):
    return a ** b
num1 = int(input('number 1 : '))
num2 = int(input('number 2 : '))
print(tavan(num1,num2))
<< Previous page 1 2 3 Next page >>

Submit answer

Submitting answers is currently unavailable.

×
×
Close