<pre id="vvttv"><mark id="vvttv"><progress id="vvttv"></progress></mark></pre>
    <pre id="vvttv"></pre>

      <p id="vvttv"></p>

          <p id="vvttv"></p>

                <p id="vvttv"></p>

                <pre id="vvttv"><cite id="vvttv"><progress id="vvttv"></progress></cite></pre>

                  <output id="vvttv"><dfn id="vvttv"><th id="vvttv"></th></dfn></output>

                    <p id="vvttv"></p>

                    ???? Python ???
                    ??7?? ????
                    ???? ??????? ????

                    ???????

                    ?????????????????????????????????????????????????????????????κι????????????????????????? ??? ????????????? ?????? ?????б???????????????????????飬???????????????????????

                    ??t??????

                    ??7.3 ??t??????

                    #!/usr/bin/python
                    # Filename: func_local.py


                    def func(x):
                        print 'x is', x
                        x = 2
                        print 'Changed local x to', x

                    x = 50
                    func(x)
                    print 'x is still', x

                    ????????code/func_local.py??

                    ???

                    $ python func_local.py
                    x is 50
                    Changed local x to 2
                    x is still 50

                    ????ι???

                    ??????У????????????x?? ? ?????Python??ú??????????βε????

                    ??????????????2????x??x???????????????????????????????????x???????????????ж????x???????

                    ????????print????У???????????????е?x??????????????

                    ???global???

                    ??????????????????????????????????????????Python?????????????????????? ??? ??????????global?????????????????global????????????????????????????????

                    ?????????????????????????????????????????????????????????????????????????????????????t??????????????????????ó?????????????????????????????????global???????????????????????????鶨????

                    ??7.4 ???global???

                    #!/usr/bin/python
                    # Filename: func_global.py


                    def func():
                        global x

                        print 'x is', x
                        x = 2
                        print 'Changed local x to', x

                    x = 50
                    func()
                    print 'Value of x is', x

                    ????????code/func_global.py??

                    ???

                    $ python func_global.py
                    x is 50
                    Changed global x to 2
                    Value of x is 2

                    ????ι???

                    global???????????x????????????????????????????????x?????????仯?????????????????????x????????

                    ????????????global?????????????????????global x, y, z??


                    ???? ????? ????
                    ?????β? ??? ???????
                    ?????
                    @ssv

                      <pre id="vvttv"><mark id="vvttv"><progress id="vvttv"></progress></mark></pre>
                      <pre id="vvttv"></pre>

                        <p id="vvttv"></p>

                            <p id="vvttv"></p>

                                  <p id="vvttv"></p>

                                  <pre id="vvttv"><cite id="vvttv"><progress id="vvttv"></progress></cite></pre>

                                    <output id="vvttv"><dfn id="vvttv"><th id="vvttv"></th></dfn></output>

                                      <p id="vvttv"></p>

                                      这里只有精品视频