HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
In the previous tutorial we have learned some basic knowledge of grammar Python3, let's try to write a Fibonacci sequence.
Examples are as follows:
#!/usr/bin/python3 # Fibonacci series: 斐波纳契数列 # 两个元素的总和确定了下一个数 a, b = 0, 1 while b < 10: print(b) a, b = b, a+b
The above program, the output is:
1 1 2 3 5 8
This example introduces several new features.
>>> i = 256*256 >>> print('i 的值为:', i) i 的值为: 65536
Keyword end can be used to output the results to the same line, or output at the end of the add different characters, examples are as follows:
#!/usr/bin/python3 # Fibonacci series: 斐波纳契数列 # 两个元素的总和确定了下一个数 a, b = 0, 1 while b < 1000: print(b, end=',') a, b = b, a+b
The above program, the output is:
1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,