To Python's section 2t

Source: Internet
Author: User
Tags terminates

# by Luffycity.com

# dead Loop
# count = 1
# while Count <= 3:
# Print ("Kill you..")
# count = Count + 1
# Number of 1-100

# count = 1
# While Count < 101:
# Print (count)
# count = Count + 2

# Let users continue to enter content and print. Exit the program until the user enters Q
# while True:
# content = input ("Please enter a word, (enter Q to exit the program):")
# if content = = ' Q ':
# break # interrupted. Terminates the current layer loop
# Print (content)

# flag = True
# while flag:
# content = input ("Please enter a number (enter 66 to exit the program):")
# if content = = ' 66 ':
# Print ("Congratulations")
# flag = False # interrupted. Terminates the current layer loop
# If content > ' 66 ':
# print ("Big, Come Again")
# If content < ' 66 ':
# Print ("Small, Come Again")


# Print (content)
# Else:
# print ("123")


# while True:
# content = Int (input, enter a word (enter Q to exit the program):)
# if content = = ' Q ':
# continue # Stops the current loop. Continue with the next loop


# The difference between break and continue: Break is to completely stop the current layer loop. Continue stop the current loop and proceed to the next loop



# count = 1
# while Count <= 10:
# if Count = = 4:
# count = Count + 1
# continue # to exclude some content
# Print (count)
# count = Count + 1

# It has to be written
# count = 1
# while Count <= 20:
# if Count = = 10:
# break # does not trigger else execution, while...else ... is a whole. Break the whole of the time to stop it completely
# Print (count)
# count = Count + 1
# Else: # Execute the code in this else when the above conditions are not true
# print ("finished")


To Python's section 2t

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.