Zero-based learning Python (2) The data type print function

type of data

Python is the most commonly used data types are these types:
string (str) integer (int) decimal (float) Boolean (bool)
So how do you judge these types of it? String usually single or double quotation marks. That is, 'something between' are strings; the integer and fractional want Needless to say; boolean types include True: True and False: false (T and F must be capitalized) if it comes to this type of data in a later statement time will be mentioned in detail.

print function

"Print" is printed means. As the name suggests, print function can print out your incoming data in the console. 4 kinds of data types mentioned above it can be printed. format print function: print ( 'data to be printed') This data is usually single quotation marks, if it is a variable, which you want to print the content is not added. To write a character called brackets mass participation, and the content of the incoming call parameters. Mentioned later when custom function will be explained in detail. In fact, there are several parameters of this function can pass, but beginning with the use of this one enough.
Here's an chestnuts:

print('1')
number = 1
print(number)

This two pieces of code can be output in the console "1." The "1" looks the same, it is in fact different data types. The first is a string (str) type, the second integer (int) type.

The thumbs and concern

Well, this issue here. For more of my attention, so you back in time to see my update. See the next issue! ! !

Released three original articles · won praise 18 · views 588

Guess you like

Origin blog.csdn.net/BearProgramming/article/details/105116689
Recommended