1.99 Variants of the multiplication table:
Idea: Use the For loop and range function to calculate the Chuyang product over and over again, and use the Format function to align right to achieve the effect on the graph.
2. Print the Diamond:
Idea: Using the mathematical function equation, establish a coordinate system with the center point as the origin point, such as:
To facilitate the understanding of the x-axis left-to-right by negative to positive, the y-axis down from negative to positive, to find out the expression of four functions, the use of the if sentence to determine the intersection of printing, the rest is "".
3. Print to the top triangle:
Ideas: With the same, take Y=x and Y=-x intersection, to print
4. Print Lightning:
The above-mentioned diamond is modified, using the IF statement to take its two or four quadrant printing
5. Ask for the Fibonacci sequence:
Idea: A method of marking is used, which is equivalent to a switch
6. Seeking prime numbers:
Idea: According to the prime number can only be 1 and its own division, in order to make its operation speed, will be even singled out, and secondly, because of the divide relationship, just to calculate to open the square around it can be.
Python Simple loop-small programming