Python Learning Note 2-tuple

Source: Internet
Author: User

Tuple:

#tuples are also lists, but the values do not changeA= ('123','234','1234')Print(a[1]) MySQL=('127.0.0.1','3306',"'Root','123456')Print(Mysql.count ('Root'))#ExampleAll_user={} whileTrue:username=input ('Username:'). Strip () passwd=input ('passwd:'). Strip () Cpwd=input ('cpwd:'). Strip ()ifUsername andPwd andcpwd:ifUsernameinchAll_user:Print('user name already exists')        Else:            ifpwd==Cpwd:all_user[username]=passwdElse:                Print('two times password inconsistency')    Else:        Print('account password cannot be empty')#Login Examplesall_users={} whileTrue:username=input ('Username:'). Strip () passwd=input ('passwd:'). Strip ()ifUsername andpasswd:ifUsernameinchall_users:passwd=All_users[username]ifpasswd==All_users[username]:Print('Login Successful')               Break           Else:              Print('Password Error')       Else:          Print('user name does not exist')    Else:        Print('The user password cannot be empty')

Python Learning Note 2-tuple

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.