Skip to content

Instantly share code, notes, and snippets.

@KenoLeon
Last active May 3, 2022 00:58
Show Gist options
  • Select an option

  • Save KenoLeon/ea748e5c7bc08a733d9fb4f807106f05 to your computer and use it in GitHub Desktop.

Select an option

Save KenoLeon/ea748e5c7bc08a733d9fb4f807106f05 to your computer and use it in GitHub Desktop.
Fibonacci in pyscript
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Fibs be cool yo !</title>
<link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" />
<script defer src="https://pyscript.net/alpha/pyscript.js"></script>
</head>
<body>
<py-script>
def fib(n):
a, b = 0, 1
while b < n:
print(b, end=' ')
a, b = b, a + b
print()
fib(100)
</py-script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment