Print 1-10, skip 6,7

Source: Internet
Author: User

Tag: equals int tin start END Declaration variable print continue break

# analysis of a person's ideas, very subtle!  # Declare variable ii = 0# The condition for the start of the loop is I is less than or equal to 10, then the code block is executed while  i <=:  # give I variable plus 1    i + = 1# If I is not equal to 6 and 7, just print the variable i.     if and i!=7:        print (i)

#assign a value to I to make it a variablei =0#Introducing Time ParametersImport Time#When the start loop condition is true, the while code block is executed.  whileTrue:#Add 1 to the I variablei = i +1#if 6 or 7, end the loop and go to the next    ifi = = 6ori = = 7:        Continue#Print if failed i    Print(i)#pause for one secondTime.sleep (1)#If the value is 10, jump out of the while loop to continue the code    ifi = = 10:         Break#Print EndPrint('End')

Print 1-10, skip 6,7

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.