File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -57,13 +57,13 @@ example, we can compute π.
57
57
<body >
58
58
<py-script >
59
59
print("Let's compute π:")
60
- def wallis (n):
60
+ def compute_pi (n):
61
61
pi = 2
62
62
for i in range(1,n):
63
63
pi *= 4 * i ** 2 / (4 * i ** 2 - 1)
64
64
return pi
65
65
66
- pi = wallis (100000)
66
+ pi = compute_pi (100000)
67
67
s = f"π is approximately {pi:.3f}"
68
68
print(s)
69
69
</py-script >
@@ -97,13 +97,13 @@ the `<py-script>` tag write to.
97
97
import datetime as dt
98
98
pyscript.write('today', dt.date.today().strftime('%A %B %d, %Y'))
99
99
100
- def wallis (n):
100
+ def compute_pi (n):
101
101
pi = 2
102
102
for i in range(1,n):
103
103
pi *= 4 * i ** 2 / (4 * i ** 2 - 1)
104
104
return pi
105
105
106
- pi = wallis (100000)
106
+ pi = compute_pi (100000)
107
107
pyscript.write('pi', f'π is approximately {pi:.3f}')
108
108
</py-script >
109
109
</body >
You can’t perform that action at this time.
0 commit comments