From d6b00e54d2c6765b59242044b6dba36531edd660 Mon Sep 17 00:00:00 2001 From: Nguyễn Gia Phong Date: Wed, 24 Nov 2021 16:09:04 +0700 Subject: Improve note styling --- blog/conseq.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'blog/conseq.md') diff --git a/blog/conseq.md b/blog/conseq.md index 5b843eb..b9ea570 100644 --- a/blog/conseq.md +++ b/blog/conseq.md @@ -65,17 +65,17 @@ but since we will only evaluate the first few terms 8 ``` -@@note -The `fibo_seq` above is just to demonstrate how `itertools.count` -can be use to create an infinite sequence defined by a function. -For better performance, this should be used instead: +!!! note "Note" -```python -def fibonacci_sequence(a=0, b=1): - yield a - yield from fibonacci_sequence(b, a + b) -``` -@@ + The `fibo_seq` above is just to demonstrate how `itertools.count` + can be use to create an infinite sequence defined by a function. + For better performance, the following should be used instead: + + ```python + def fibonacci_sequence(a=0, b=1): + yield a + yield from fibonacci_sequence(b, a+b) + ``` It is noticable that the elements having been iterated through (using `next`) will disappear forever in the void (oh no!), but that is the cost we are -- cgit 1.4.1