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.
1- The user selects a number from 0 to 100 in his mind 2- The program guesss the user's desired number 3- The user according to the guessing number is one of the options (the correct guess, the number is larger, the number ... Moore ...
Online Store with the following features to add new product by Admin in the Management Panel Panel User Name by User Selecting and Registering (Online Payment and Home Payment Option ...
Write a program that, like a dice, prints a random number between 1 and 6 in the output with each time running
Write a function that receives the user's postcode as a parameter and checks whether the postcode is correct? Must be 15 digits?
Write a program where the user can enter the clock, minutes and seconds as the example below and from the time entered, the countdown to zero is Input: 1:22:50 # One hour and twenty minutes and fifty seconds
Write a function to get a string and return the length of the string Tip: In this exercise you should not use ready -made functions like Len in Python
برای استفاده از این بخش باید وارد حساب کاربریت بشی
ورود/ثبت نام 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.