zoukankan      html  css  js  c++  java
  • 变量

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

           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)

    冷垚
  • 相关阅读:
    pip install
    自动更新高清电影文件中文名
    csv、excel导入oracle
    02_Jenkins配置任务
    01_Jenkins windows安装
    run_jmeter.py
    02_禅道的基本使用
    01_禅道搭建手册
    01_charles 下载安装(破解版)
    06_Linux常见的命令
  • 原文地址:https://www.cnblogs.com/lengyao888/p/10196780.html
Copyright © 2011-2022 走看看