第 4 步:让我们计算圆的面积。一个圆的面积是 πr 2 ,所以我们需要创建一个变量来存储这个值。
- 在逻辑选项卡中,单击并拖出my_circle正下方的Float Variable 。
- 将变量名从my_var更改为circle_area 。
- 将circle_area的值从2.34更改为方程3.14 * ( 25 / 2 ) ** 2 。
3.14 是 π 的值,半径是我们的直径除以 2,** 2 是如何在 Python 中对一个数字求平方!
To navigate the page using the TAB key, first press ESC to exit the code editor.