2018年1月8日 星期一

Python: Get the the volume of a sphere with radius 6

Python: Get the the volume of a sphere with radius 6

Python Basic: Exercise-15 with Solution

Write a Python program to get the the volume of a sphere with radius 6.
Python: Volume of a Sphere
A sphere is a three-dimensional solid with no face, no edge, no base and no vertex. It is a round body with all points on its surface equidistant from the center. The volume of a sphere is measured in cubic units.
The volume of the sphere is : V = 4/3 × π × r3 = π × d3/6.
Python : Volume of a sphere
Sample Solution :-

pi = 3.1415926535897931
r= 6.0
V= 4.0/3.0*pi* r**3
print('The volume of the sphere is: ',V)

=========== RESTART: F:/Python_APSC/py-ex-basic-15.py ===========
The volume of the sphere is:  904.7786842338603
>>> 

沒有留言:

張貼留言

2024年4月24日 星期三 Node-Red Dashboard UI Template + AngularJS 參考 AngularJS教學 --2

 2024年4月24日 星期三 Node-Red Dashboard UI Template + AngularJS 參考 AngularJS教學 --2 AngularJS 實例 <!DOCTYPE html> <html> <head> &...