<dd id="sga4y"><optgroup id="sga4y"></optgroup></dd>
<nav id="sga4y"><code id="sga4y"></code></nav>
  • <optgroup id="sga4y"></optgroup>
    ???? Python ???
    ??6?? ??????
    ???? break??? ????

    break???

    break????????? ??? ???????????????????????§Ô??False?????§Ý???§Ò??????ï…????????????

    ????????????????????for??while????? ??? ???¦Ê¦Æ???????else?ýq????§³?

    ???break???

    ??6.4 ???break???

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


    while True:
        s = raw_input('Enter something : ')
        if s == 'quit':
            break
        print 'Length of the string is', len(s)
    print 'Done'

    ????????code/break.py??

    ???

    $ python break.py
    Enter something : Programming is fun
    Length of the string is 18
    Enter something : When the work is done
    Length of the string is 21
    Enter something : if you wanna make your work also fun:
    Length of the string is 37
    Enter something :       use Python!
    Length of the string is 12
    Enter something : quit
    Done

    ????¦É???

    ??????????§µ??????????????????????????????????????????????????????????????????????????????????????'quit'????? ??? ???????????¦Â????????

    ??????????????????????len??????¨¢?

    ?????break??????????for???????¨¢?

    G2??Python?

    ???????????????????§Õ?????§³??????G2??Python???

    Programming is fun
    When the work is done
    if you wanna make your work also fun:
          use Python!


    ???? ????? ????
    for??? ??? continue???
    ?????
    @ssv 97av