CodeSolved

Solved Programming Questions & Exercises

Power calculation function

Practice Easy 8/ Download 2450 Views

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

19 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.
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))
a=int(input("enter your number:"))
b=int(input("enter your number:"))
x=(a**b)
x=str(x)
print('a power b =' + " " + x)
Omid.asadi Download Python
<< Previous page 1 2 Next page >>

Submit answer

Submitting answers is currently unavailable.

×
×
Close