Old boy Python Network Class-Day01 job-simulated login system, python-day01

Source: Internet
Author: User

Old boy Python Network Class-Day01 job-simulated login system, python-day01

Simulate the operations, condition statements, and loops of the main exercise files in the login System

Knowledge point:

1. str. strip ([chars]):

Delete all spaces at the front and back of the string. The chars parameter can be used to customize the characters to be deleted. Optional.

Input (). strip () can remove spaces when a user inputs to avoid unnecessary errors.

Usage:

Account = input ('Enter the account: '). strip ()

 

2. str. upper ()

Converts all lowercase letters in a string to uppercase letters.

Command = input ('Enter the command: '). strip ()
If command. upper () = 'A ':
Add_user (database)
This item is executed no matter whether the input command is A or.

3. dict. get (key)
Obtains the value corresponding to the key in the dictionary. If the key does not exist, None is returned,
If database. get (account) = None:
If the key does not exist, no error is reported.
 
 

 

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.