Python基础(一)

爷,独闯天下 提交于 2019-11-29 04:57:31

一、python简介

1.1、变量

1)变量字符中只能存在有字母,数字,下划线

2)不能以数字开头

3)不能是关键字:

'and', 'as', 'assert', 'break', 'class', 'continue', 'def', 'del', 'elif', 'else', 'except', 'exec', 'finally', 'for', 'from', 'global', 'if', 'import', 'in', 'is', 'lambda', 'not', 'or', 'pass', 'print', 'raise', 'return', 'try', 'while', 'with', 'yield'

4)不要和python内置的东西重复

5)最好见名知意,单词一直可以下划线分割,如user_id

1.2、基本语句

1)条件语句

#if基本语句
if 条件:
	内部代码块1
else:
	内部代码块2

print('....')
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!