Python Loop Selection Branch Five

Source: Internet
Author: User

This is the content of the December plan, beginning in January 2018 ~

If there is any mistake, please ask for it ~

It's almost like any other language.

1  while Judging Condition: 2     Statement

But it doesn't have to do. While loop, note the indentation

That's the basis of nesting,

But for the more varied

A For loop can traverse any sequence of items

1 list=['a','b','c'  ]2 for in List:3     print(i)
Abc

Range, with (Start, end, step), step can not be written

1  for  in range (1,10,2):2     print(i)
13579

Break and continue are still the same usage, like the dead loops are also similar

Branching structure

The keyword for the IF statement is:if–elif–else

Python Loop Selection Branch Five

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.