python学习(1)python的基本概念

1、python是世界上最流行的程序语言之一,用途广泛。

2、python是解释型语言,与C++编译类语言相比,python扩展性强,简单易上手。但是缺点也很明显,执行速度慢。

3、python定义中,没有常量这个概念,只有变量的概念。尽量不要使用中文和拼音来定义变量。

学习代码:

1 # Author;show530
2 
3 name = "show530"
4 name2 = name
5 print("My name is ",name,name2)
6 
7 name = "hongtao"
8 print(name,name2)

运行之后显示:

1 My name is  show530 show530
2 hongtao show530

name2在第4行就完成了赋值,直接赋值show530,name在第7行被重新赋值,但是不影响name2。

原文地址:https://www.cnblogs.com/show530/p/8495845.html