• Python-Day2-python安装、变量与变量作用、变量和常量


    Python安装

    变量与变量作用

    用于存信息——把数据放在内存中

    描述信息——便于理解

    参考:

    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.

    变量与常量

    -------------------------------------------------------------

    变量的修改

    a=1      

    a=b

    print('b')    ->b=1

    a=3         

    print('b')    ->b=1      #b为什么还是等于1而不是等于3

               #因为a=b是把b直接指向了a的值1,而不是a这个变量本身。变量的值改变后要再执行一次a=b,这时b的值就会等于3。

    -------------------------------------------------------

    常量

    Python中没有常量的概念,约定所有字母大写为常量。

    常量   ——    AGE_OF_XX=20

  • 相关阅读:
    HOG特征提取+python+opencv
    统计模型计算量~pytorch
    CycleGAN训练~训练图像进行拼接
    缺陷检测~分类网络
    缺陷检测~分类网络
    缺陷检测~检测网络
    pytorch中的fc和fc逆操作
    pytorch中的view和view逆操作
    传统的图像特征提取
    TensorFlow安装+入门操作
  • 原文地址:https://www.cnblogs.com/AYxing/p/8387785.html
Copyright © 2020-2023  润新知