变量

2018-05-06  本文已影响0人  今天要努力

变量
变量是指向某个值的名称。

1. 赋值语句
用于新建变量,并为该变了赋值。

>>> num = 18
>>> message = 'Hi, Python!'

2. 变量名命名规范

>>> help('keywords')                            # 默认为 Python3
Here is a list of the Python keywords.  Enter any keyword to get more help.

False               def                 if                  raise
None                del                 import              return
True                elif                in                  try
and                 else                is                  while
as                  except              lambda              with
assert              finally             nonlocal            yield
break               for                 not                 
class               from                or                  
continue            global              pass  
驼峰体  AgeOfLuffy = 22
下划线  age_of_luffy = 22
PI = 3.1415926
上一篇 下一篇

猜你喜欢

热点阅读