<menu id="guoca"></menu>
<nav id="guoca"></nav><xmp id="guoca">
  • <xmp id="guoca">
  • <nav id="guoca"><code id="guoca"></code></nav>
  • <nav id="guoca"><code id="guoca"></code></nav>

    python 寫完一行怎么換下一行


    發現錯別字 2年前 提問
    回答
    1
    瀏覽
    8899
    請勿發布不友善或者負能量的內容。與人為善,比聰明更重要!
    回答數量: 1
    等保中級測評師 CICSA

    Python中如果遇到一行寫不完需要換行的情況,有兩種方法:

    1.在該行代碼末尾加上續行符“ \”。

    test = 'Network'
    'security'
      'guard'

    輸出結果:

    ‘Networksecurityguard’

    2.加上括號,() {} []中不需要特別加換行符。

    test2 = ('Network '
    'security')

    輸出結果:

    Network security

    if…and:

    if (where there is a will and

    多次未輸出結果

    test3 =('Network'
    ' '
    'security')

    輸出結果:

    Hello world

    回答所涉及的環境:聯想天逸510S、Windows 10。

    2年前 / 評論
    亚洲 欧美 自拍 唯美 另类