0010_while loop, while loop

Source: Internet
Author: User

0010_while loop, while loop

While condition:

Code block

Break: Skip loop statement

Continue: jump out of this loop and enter the next loop.

1 _ author _ = 'prop 93 '2 #! /Usr/bin/env python 3 #-*-coding: UTF-8-*-4 ''' 5 import time 6 a = 0 7 while (! = 100): 8 print ("1") 9 time. sleep (1) 10 a + = 111 print ("Over") 12 '''13''' 14 import time15 a = 116 while True: 17 print () 18 if (a = 10): 19 break # used to jump out of the current loop statement continue used to jump out of this loop and continue the next loop 20 a + = 121 time. sleep (1) 22 print ("End") 23 ''' 24 a = 025 while a <a + = 127 if (a = 7 ): 28 continue29 print ()

 

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.