On the use of user interaction, play a role in python to be the input, input (str).
As in python placeholders%, s d equivalent string type represents the digit for (digital)
course there code system, embodied to the terms. '' '(' '') ---------------------------------- '' '(' '')
Like to read not only read and write code "#" sign at the head of the code.
But here there is a format output. The user interaction is fully reflected.
name = input ( "Please enter your contact's name:") Age = the INPUT ( "Please enter your age, contact:") height = the INPUT ( "Please enter your contact's height:") Hobbie the INPUT = ( " Please enter your contact's hobby: ") #message = 'my name is% s, my age,% s, my height S%'% (name, Age, height) the Message = --------- Contact info% of S ---- ----------------- name: S% Age:% D height:% S Hobbie:% S -------- ------- end -----------------% (name, name , int (age), height,
= ------- the Message i = 0 the while i <3 : username = the INPUT ( " Please enter your login: " ) password = the INPUT ( " Please enter your password: " ) IF username == " Lu Zhi " and password == " 123 " : # this is not a pure digital can not use int, will go wrong" Print ( " successful landing " ) the else : Print ( " login failed, please try again. ") i += 1------- print(message)
bool variable Ture Flase. two. 0 to False zero as Ture. (Usually 0 error, 1 is right. Deeply influenced by the c ++)
About operators is nothing more than that. There is only speaking head logical operators.
and(&&),or(||),not(!)
If you want to open yourself to know high school math textbooks. That chapter Speak Logic chapter.
#and and would like to return value or on anti
# A or ba ture returns to A;
# a or ba ture B to return;
# for Python
# priority ()> Not> and> or;
# 0 is converted to bool false positive nonzero
print(0 < 1)
True
>>> print(0 < -1)
False
>>> print(0 and 1)
0
>>> print(0 or 1)
1
>>> print(1 or 0)
1
>>> print(1 and 0)
0
>>> print(1 and 0)
0
>>> print(1 and 1)
1
>>> print(1<2 and 1)
1
>>> print(1<2 or 1)
True
>>> print(0 or 1)
1
>>> print(0 and 1)
0
>>> print(1 and 2)
2
# Us ascii code most edge zero, 8 (bit) = 1 byte
# in a Chinese Unicode with (unicode) 4 bytes, in a Chinese utf-8 3 bytes. But people own a Chinese gbk 2 bytes. For domestic use only
# byte = b
1024B = 1KB, 1024KB = 1MB, 1024MB = 1GB, 1TB = 1024GB, 1PB = 1024TB 1024pb = 1Zb.
The computer compares the median on the divided 8bit, 16bit, 32bit, 64bit. It can only For example a binary identification 0101010101010101010http:
About ascii code hexadecimal binary octal reference to the following links.
http // www.cyb-sound.com / forum / viewthread.php? tid = 63