• 变量


    变量
           变量是为存储程序运算过程中的一些中间结果,为了方便日后调用

           Variables变量 are used to store保存、储存 information信息 to be referenced被日后调用 and manipulated操作或更改 in a computer program程序. They also并且还 provide提供 a way方式 of labeling标记 data数据 with a descriptive描述性                name, so our programs can be understood理解 more clearly更清晰 by the reader阅读者 and ourselves我们自己. It is helpful to think of variables as containers容器 that hold保持、保存 information(如果我们把变量看作成是一个保存信息的容          器是更容易理解的). Their sole主要 purpose目的 is to label标记 and store存储 data in memory内存里. This data数据 can then然后 be used使用它 throughout整个 your program.

    变量的命名规则

          1. 要具有描述性
          2. 变量名只能_,数字,字母组成,不可以是空格或特殊字符(#?<.,¥$*!~)
          3. 不能以中文为变量名
          4. 不能以数字开头
          5. 保留字符是不能被使用

    常量

          不变的量

                      pie = 3.141592653....
          在py里面所有的变量都是可变的 ,所以用全部大写的变量名来代表次变量为常量


    hellowworld.py


    print("Hellow world!")
    x = 3
    y = 4
    z = x * y
    print("x乘以y等于",z)
    print("z = ",z)

    print(3*4*5*6/2)

    z = 7*8
    print("z = ",z)

    冷垚
  • 相关阅读:
    TSQL 备份和还原
    SQL检查死锁情况
    局域网中“隐身”妙招 类似360的局域网隐身
    注册edu邮箱的办法
    C#读、写、删除注册表
    SQL备份计划
    GridView命令不够用怎么办?
    从智能设备访问SQL2000的数据
    智能设备访问SQL2000(一)
    字符HTML编码类(转)
  • 原文地址:https://www.cnblogs.com/lengyao888/p/10196780.html
Copyright © 2020-2023  润新知