There are eight key elements of python

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了There are eight key elements of python相关的知识,希望对你有一定的参考价值。

1. data type

2. variant

        grammer: objectReference = value

    ‘=‘  means bind a variant with object in memory.

     variant name is case sensitive in pyhon.

3. combination data type

    major types are meta and list

    meta is fixed.

    list is changable.

    #x.append(xxx)  == list.append(x,‘xxx‘)

    There are two call methods in python. as following.

    functionName(arguments)

    objectName.methodName(arguments)

4. logical operator

    sometimes "is" will give you a different result. in fact. its compared with memory object.

    0<=a<=10 equal a>=0 and a<=10

    "in" is better used in dict

5. control

    a.
    if boolean_expression1:

        suite1

    elif boolean_expression2:

    ....

    else:

        else_suite

    b.

    while boolean_expression:

        suite

    c.

    for variable in iterable:

        suite

6. mathmatic

    list must use iterable object.

    e.g. seeds+=5 # will get error

            seeds+=[5] #correct

7. IO

    try:

        ...

    except ValueError as err:

        print(err)

        continue

    except EOFError:

        break

8. function

    def functionName(argument1,a2,a3...):

            suite

以上是关于There are eight key elements of python的主要内容,如果未能解决你的问题,请参考以下文章

English trip V1 - 11.What's That? 那是什么?Teacher:Patrick Key:There's/There are

npm 不起作用,总是出现这个错误 -> 错误:找不到模块'are-we-there-yet'

There are no packages available

Linux exit时出现there are stopped jobs

Linux exit时出现there are stopped jobs

Spirng 循环依赖报错:Is there an unresolvable circular reference?