The numeric data type python

A data type basis Introduction

When variables are defined in python is no need to declare type.

Data types can be divided into the python numeric and non-numeric type.

Digital type: integer, float, boolean, a complex type.

Non-numeric type: strings, lists, tuples, dictionaries.

You can view using the type of a variable types: type (variable name)

Second, the calculated data between different types

1 can be directly calculated between the digital type;

2. Use of type string for string concatenation +;

* 3. The string can be repeated string concatenation, for example, "nihao" * 3, the result is "nihaonihaonihao";

It can not be any other computing between 4 and numeric strings;

Guess you like

Origin www.cnblogs.com/xiximayou/p/12132136.html