Python

  1. 数据类型
    三种分别是:字符串(string)、整数(integer)、浮点数(float)
    eg:str='字符串'、int=33、float=3.24
    区别:字符串的识别方式非常简单——有层名为【引号】的皮,只要是被【单/双/三引号】这层皮括起来的内容,不论那个内容是中文、英文。只要是被括起来的,就表示是字符串类型。整数其实和数学中定义的一样:是正整数、负整数和零的统称,是没有小数点的数字。注:没有引号 浮点数非常好识别,它比整数多了一个小数点『.』,比如下列代码中的数字都是浮点数。
  2. 数据的应运
    四则运算:先算括号里的在乘除加减
    字符串的拼接:+
    数据类型的查询——type()函数

    who = '我的'action = '是'destination = '镜像世界'number = 153code = 3.32print(type(who))print(type(action))print(type(destination))print(type(number))print(type(code))

    结果:
    bash:124$ python ~/classroom/apps-1-id-5cd9765619bbcf0001554798/124/main.py
    <class 'str'>
    <class 'str'>
    <class 'str'>
    <class 'int'>
    <class 'float'>

    作用:可以验证数据类型

sessionStorage

    <!DOCTYPE html>    <html>    <head>    <meta charset="utf-8">    <title>菜鸟教程(runoob.com)</title>    </head>    <body>        <div id="result"></div>        <script>    // 检测浏览器支持    if (typeof(Storage) !== "undefined") {        // 存储        sessionStorage.setItem("lastname", "Smith");        // 检索        document.getElementById("result").innerHTML = sessionStorage.getItem("lastname");    } else {        document.getElementById("result").innerHTML = "Sorry, your browser does not support Web Storage...";    }    </script>        </body>    </html>

可以在Application中的sessionStorage查看

for循环

*注意:使用的时候尽量弄清楚循环的次数和相关数据尽量不要把数据弄错