Advertisement
willysec_id

Program penghitung luas dan keliling lingkaran

Feb 21st, 2021
913
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | None | 0 0
  1. phi = 3.14
  2.  
  3. def LuasLingkaran(r):
  4.     luas = phi * r * r
  5.     print("Luas lingkaran: %f" % luas);
  6.  
  7. def KelilingLingkaran(r):
  8.   keliling = phi * (r + r)
  9.   return keliling;
  10.  
  11.  
  12. r = input('Masukan jari-jari lingkaran: ')
  13. print("Keliling lingkaran: " + str(KelilingLingkaran(int(r))))
  14. luas = LuasLingkaran(int(r))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement