Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
HikaGenji authored May 29, 2024
1 parent 4b924ce commit 7f8e244
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,23 @@ <h1>Loading...</h1>

<section class="pyscript">
Hello world! <br />
This is the current date and time, as computed by Python:
we define a function f as
<script type="py">
from pyscript import display
import statistics
def f(l):
return [statistics.median(l)]
return {'median': statistics.median(l), 'range': l.max()-l.min()}
x = [2, 2, 2, 3, 3, 5, 5, 6, 6, 6, 7, 7]
display("x=")
display(x)
display("f(x + [2])=")
display(f(x + [2]))
display("f(x + [5])=")
display(f(x + [5]))
display("f(x + [6])=")
display(f(x + [6]))
display("f(x + [7])=")
display(f(x + [7]))
</script>
</section>
</body>
Expand Down

0 comments on commit 7f8e244

Please sign in to comment.