Python basic data types

Python basic data types

table of Contents

  • View data type (type)
  • Floating point (float)
  • Boolean (True)(flase)
  • Character (str)

View data type

To view the data type of this variable in python, you need to know the (type) function, but in python, you can type the function type and pycharm cannot output it. At this time, you need the print() function, which is to print meaning.
Insert picture description here

Integer (int)

In the python world, there are many types of data, so let's talk about
integers today .
Integer type : data like 1~100.
The code name of integer in python: the word (int).
Insert picture description here

Floating point (float)

The term floating point sounds relatively unfamiliar, but you will know it in another way,
that is, decimal, floating point is decimal type, for decimals like 1.2, 1.6. The display float represents the floating point type.
Insert picture description here

Boolean

The Boolean type is (True), (flase) and null (None). The value True means true value.
The meaning of flase is a false value. In pycharm, it is judged whether a formula is established. If it is established, it will return True. If it is not established, it will return flase. In fact, True is also equivalent to the integer "1" flase is equivalent to 0 Just no.

Insert picture description here

Insert picture description here

Character type (str)

The character type refers to those letters, such as sheep, bee, these words are all character types. That is, str will be displayed.
Insert picture description here

to sum up

Basic data types: integer (int), floating point (float), boolean (true), (flase), (none),
character (str), these are the basic types of data

Guess you like

Origin blog.csdn.net/qq_46278558/article/details/109229177