Last active
May 3, 2022 00:58
-
-
Save KenoLeon/ea748e5c7bc08a733d9fb4f807106f05 to your computer and use it in GitHub Desktop.
Fibonacci in pyscript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!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