Python enables users to enter a number between 1-100 at will. Print all numbers from 1-1000 that can be divisible by this number, and print the serial number. The serial number starts from 1, and increases by 1.

1. Xiaoguan today introduces a classic example of python, the topic is as follows:

Use python to enable users to enter a number between 1-100 at will. Print 1-1000,

All numbers that can be divisible by this number, and print the serial number. The serial number starts from 1, and increases by 1.

2. At the beginning, Xiaoguan wrote 20 lines of code and realized it. Later, it was found to be slightly complicated. After continuous deletion and modification,

Finally, the problem was easily solved with 9 lines of code

3. Come on, show:

 

 

 

 

4. Later, Xiaoguan increased the difficulty by himself, and printed out the index of all the numbers that can be divisible by the way.

 

 

 ............

I hope I can help everyone, I ask you if you want a like, will you give it, thank you all.
Copyright statement: The copyright of this article belongs to the author (@攻城狮小关) and CSDN. Welcome to reprint, but you must keep this paragraph without the author’s consent Statement, and provide the original link in an obvious place on the article page, otherwise the right to pursue legal responsibility is reserved.
It is not easy for everyone to write articles, please respect the fruits of labor~ 
Communication plus Q: 1909561302
Blog Park Address https://www.cnblogs.com/guanguan-com/

Guess you like

Origin blog.csdn.net/Mumaren6/article/details/108761417