The best The first step in programming Python3 Tutorial In 2024, In this tutorial you can learn The first step in programming Python3
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,