Lpthw stupid way to learn Python chapter 33

Source: Internet
Author: User

The 32-33 chapters will be for-loop and while-loop loops.

The two kinds of syntax will not be said. Simply say the individual's understanding for and while.

I think he learn python.

First say the same point:

1, can not do a single operation, For-loop if the collection is empty, the condition behind the while is false he can also do a loop operation is not done, the test method is as follows:

  

 for inch  []:     Print " 1 " , I,    

 

  

 While I <=2:    Print 1,    + = 1    

2, the difference is that For-loop objects can be iterated, that is, you can read something in the body of the loop.

The loop control of the While-loop is a Boolean control that can be cycled as long as a Boolean value is finally fed back.

Lpthw stupid way to learn Python chapter 33

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.