Luffy-python Development Training-1th Chapter

Source: Internet
Author: User

The first chapter, as seen before, all more familiar. The first is to introduce Alex himself and his 50-dollar eye model. In fact, the history of the Python language is introduced.

Then there are some basic concepts, such as what is a variable and what is a constant.

The type of programming language, such as the interpreted type, such as the compiled type.

Then some data types are spoken, such as numbers, strings, booleans, and so on.

The most important thing is to talk about the process control statements.

This stickers a few of their own knocking code.

Guess the age of small games.

#__*__ coding:utf-8 __*____author__="david.z"My_age= 31Count=0 whileCount < 4: Guess_age= Int (Input ("guess my Age:"))    ifGuess_age = =My_age:Print("you are so good, you guessed it! ")         Break    elifGuess_age <My_age:Print("I guess it's too small! ")    Else:        Print("guess it's too big! ") Count+ = 1ifCount = = 4: Choice= Input ("has reached 4 times, do you want to continue to guess? Enter Y or Y to continue")        ifChoice = ="y" orChoice = ="Y": Count=0Else:            Print("you have given up guessing age! ")

#Author "David.zImportLoginImportGetpass_username='Alex'_password='123'#assigning user-entered content to the name variableuser = input ("Please enter user name:")#pwd = getpass.getpass ("Please enter password:")PWD = input ("Please enter your password:")ifuser = = _username andPWD = =_password:Print("Welcome User%s Login"%user)Else:    Print("wrong username or password")#Print What you have enteredPrint(USER,PWD)

Luffy-python Development Training-1th Chapter

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.