my learn python

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
About the character:
Character code (English: Character encoding), also known character set code is the character set of character encoding specified collection of certain objects (e.g.: bit pattern, a natural number sequence , octet or electrical pulses ), to the text in the computer and stored via the communication network transfer. Common examples include the Latin alphabet encoded into Morse code and the ASCII . Wherein, the ASCII letters, numbers and other symbols numbers , and with 7 bits of binary to represent the integer. Typically use an additional bit extension, in order to facilitate a byte is stored.
In the early development of computer technology, such as ASCII (1963) and EBCDIC (1964 years) this becoming the standard character set. But these character sets limitations soon become obvious, so people have developed many ways to extend them. Including support for East Asian CJK characters family, including writing system requirements can support a greater number of characters, and the need for implementing systems that encode these characters, rather than a temporary method.
Of course, including gbk, big5, utf, unicode ...........................
And many of them are practical in the home country, for example gbk
But this is nothing more than the local country borders.
However, utf-8, utf-16 (be, le), utf-32 (be, le). Either time for space or space for time.
 
 
 
 

Guess you like

Origin www.cnblogs.com/luzhi0324/p/11613296.html
Recommended