Advertisement
MasterGun

Python square findng

Apr 28th, 2021
686
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.34 KB | None | 0 0
  1. #Основні перемені
  2. i = int(5)
  3. p = float(3.14)
  4. radius = float(0)
  5. #Цикл доки користувач не захоче завершити програму
  6. while i == 5:
  7.     #Запит вичислити чи ні та ввід радіусу
  8.     #Asking user if he wants to find square or not and entering radius
  9.     print ("Would you like to find square of circle ? Type 1 to agree and 0 or any other number to deny")
  10.     choice = int(input())
  11.     if choice == 1:
  12.         print("Enter radius")
  13.         radius = float(input())
  14.     else:
  15.         print("Ok. Stopping program")
  16.         break
  17.  
  18.  
  19.  
  20.    
  21.     #Ввивід результату
  22.     #Output of result
  23.     result = float(pow(radius,2)*p)
  24.     print("Your result is: ", result)
  25.  
  26.     print("Would you like to continue finding squares(type in 1) or close program(type any number)")
  27.     choice = 0
  28.     #Запит на повторне вичесленян площі, при відмові зупинення та закритя програми
  29.     #Asking if user wants to continue finding squares
  30.     choice = float(input())
  31.     if choice == 1:
  32.         print ("Okay, continuing")
  33.         print("   ")
  34.         print("   ")
  35.         print("   ")
  36.         print("   ")
  37.         continue
  38.     else:
  39.         print("Okay, made by Max Trotsenko, closing program")
  40.         break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement