DrAungWinHtut

menu.py

Jul 21st, 2025
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.37 KB | None | 0 0
  1. import os
  2.  
  3. while True:
  4.     os.system('cls')
  5.     print('0-Exit')
  6.     print('1-Area')
  7.     print('2-Screen Clear')
  8.     ans = input('Choose 0,1,2: ')
  9.     ans = int(ans)
  10.  
  11.     if ans == 0:
  12.         print('Bye!')
  13.         exit(0)
  14.  
  15.     if ans == 1:
  16.         r = input('enter r: ')
  17.         r = float(r)
  18.         a = 3.14 * r * r
  19.         print(f'area = {a} for radius = {r}')
  20.  
  21.     if ans == 2:
  22.         os.system('cls')
  23.  
  24.     os.system('pause')
Advertisement
Add Comment
Please, Sign In to add comment