Python process judgment multi-layer cycle learning notes

Source: Internet
Author: User

passwd = ' Test ' creates a variable

Logout_flag = False if login equals false, continue to enter password

For I in range (4): Loop 4 times

User_input = raw_input ("Please input your passwd:"). Strip () assigning user input passwd times

If Len (user_input) = = 0:continue count from 0 onwards, continue continued meaning

if user_input = = passwd: Determine user input password

While true: if the login is true, select the following options

Print "Welcome login!"

User_choice = Raw_input ("'

1. Run a cmd

2. Send a file

3. Exit this level

4. Exit the whole system

"). Strip ()

user_choice = Int (user_choice)

if User_choice = = 1: rolled out until 4 cycles

Print "Going to run cmd"

if User_choice = = 2:

Print "Going to sed a file"

if User_choice = = 3:

Print "Going to exit this"

Break

if User_choice = = 4:

Logout_flag = Ture

Break Break represents exit while True: Loop

If Logout_flag:

Print "Going to logout"

Break Break represents exiting for loop

Print "---going to do something else ..."


This article is from a "glass of water" blog, please be sure to keep this source http://6528161.blog.51cto.com/6518161/1916475

Python process judgment multi-layer cycle learning notes

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.