#Chapter1# Python Basics

2018-04-29  本文已影响9人  Jacaranda2016

1. Everything in Python is an object: every number, string, data structure, function, class, module are all referred to as a Python object.

2. Variables and argument passing

a=[1,2,3]  # assigning a variable, we are creating a reference to the object on the right side of the equals sign

b=a  # [1,2,3] has not been copies; now a and b refer to the same object

3. Dynamic reference, strong type

Object reference in Python has no type associated with them.Variables are names for objects within a particular namespace; the type information is stored in the object itself. But Python is a strong type language.

4. Mutable and immutable objects

lists, dictionaries, NumPy arrays and self-defined are all mutable; tuple, string are immutable.

5. Scalar types

scalars/scalar types: numerical data, strings, boolean values, and dates and time.

上一篇下一篇

猜你喜欢

热点阅读