Numbers to power 2
Write a program that receives a number from the input and increases the number 2 and prints in the output. This trend continues until the number 0 is not arrived
Write a program that receives a number from the input and increases the number 2 and prints in the output. This trend continues until the number 0 is not arrived
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
while 1: number=float(input("enter numbers:")) a=number**2 if number !=0: print(a) else: break print("end")
def main(): while True: # Get a number from the user number = float(input("لطفاً یک عدد وارد کنید (برای خروج 0 را وارد کنید): ")) # Check out of the loop if number == 0: print("برنامه به پایان رسید.") break # Calculating and printing power of 2 pcs squared = number ** 2 print(f"{number} به توان 2 برابر است با: {squared}") # Implementation of the program main()
while 1: number = int(input("enter num: ")) if number != 0: power = number ** 2 print(power) else: break print("end")
number = 1 while True: try: if not number == 0: number = int(input("enter your number:")) print(f"your number:{number ** 2}") else: break except: print("eror")
while 1: number = int(input("please enter a number: ")) if number == 0: break else: print("number ** 2 = ", number ** 2)
number = int(input("enter your number:")) tavvan = number ** 2 if number == 0: print("end") else: print(tavvan)
def print_nums_power_of_two(n): while n == 0: print("Because the number zero reaches the power of two, the result is zero, the program closes!!") break else: print(f"The number {n} to the power of two {n ** 2} is.") print_nums_power_of_two(int(input("Enter a number: "))) print_nums_power_of_two(int(input("Enter a number: ")))
Submitting answers is currently unavailable.
Write a program that receives a number of input and the factoriel calculates and prints it
Write a program that receives an email address and separates the various sections as follows and prints on the output example: email: [email protected] info amirhn.ir Example: email: [email protected] username gmail.com
برای استفاده از این بخش باید وارد حساب کاربریت بشی
ورود/ثبت نام 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.