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