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
def tavan(a,b): return a**b print(tavan(a=int(input("enter your number:")),b=int(input("entre your number:"))))
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): 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 وارد کنید.")
a = int(input ('enter number')) b = int(input ('enter number')) total = a ** b print (total)
def tavan(): a = float(input("Adad1: ")) b = float(input("Adad2: ")) return a**b print(tavan())
a = int(input("enter a:")) b = int( input("enter b:")) print("a**b=",b**a)
def power(a, b): """این تابع عدد a را به توان b میرساند و نتیجه را برمیگرداند.""" return a ** b # Function test if __name__ == "__main__": # Get input from the user a = float(input("لطفاً عدد a را وارد کنید: ")) b = int(input("لطفاً عدد b را وارد کنید: ")) result = power(a, b) print(f"{a} به توان {b} برابر است با: {result}")
num1 = float(input("num1: ")) num2 = float(input("num2: ")) print(" num1 ** num2 ={}".format(num1**num2))
Submitting answers is currently unavailable.
Write a class that receives two numbers and the methods of subtraction, multiplication and division can be called. By calling each method, the necessary calculations are required and the result is returned in
Write a program that receives a number and prints the figure below according to the number, the Number Example: 3 #######Number Example: 5 #######################
Design the database of a restaurant and write a query about making tables and keys. Tips: In this restaurant we want to have a list of foods, orders and customers in the system
Write a program that receives a number from the user and converts to letters suppose the numbers entered between 0 and 1000000 23 ➞ Twenty Three 405 ➞ Four HundredR
Write a program that receives the infinite number of the number with the help of a graphical interface and performs the compact, multiplication and division on them, for example the user should be able to do the results of the following actions using this ...
Write a program that receives a number and only by moving its figures, the smallest numbers can be found (with the same number of digits)
برای استفاده از این بخش باید وارد حساب کاربریت بشی
ورود/ثبت نام 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.