码迷,mamicode.com
首页 > 编程语言 > 详细

python~~第一天

时间:2017-03-20 22:27:25      阅读:204      评论:0      收藏:0      [点我收藏+]

标签:python   需要   glob   while   第一个   地址   内容   and   编程   

人生短暂,我用python~

print(‘人生短暂,我用python‘)  #第一句编程

printf(5+1) #结果是6 , 

n1 = 5

n2 = 1

printf(n1 + n2)  #结果当然也是6

这就是python中的变量了,变量的作用:昵称,其代指内存里某个地址中保存的内容(我自己的理解就是和现实中 每个人都需要有一个名字一样,hh),命名当然也有规则--

  • 变量名只能是 字母、数字或下划线的任意组合
  • 变量名的第一个字符不能是数字
  • 以下关键字不能声明为变量名
    [‘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‘]

然后就是 if 语句 和 whlie

           

 

python~~第一天

标签:python   需要   glob   while   第一个   地址   内容   and   编程   

原文地址:http://www.cnblogs.com/rw-boke/p/6591847.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!