<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                # 練習29. IF 語句 下面是你要寫又一個python腳本,這節練習會向你介紹“if語句”。把這段代碼輸入腳本,讓它正常運行,看看你有沒有什么收獲。 ~~~ people = 20 cats = 30 dogs = 15 if people < cats: print "Too many cats! The world is doomed!" if people > cats: print "Not many cats! The world is saved!" if people < dogs: print "The world is drooled on!" if people > dogs: print "The world is dry!" dogs += 5 if people >= dogs: print "People are greater than or equal to dogs." if people <= dogs: print "People are less than or equal to dogs." if people == dogs: print "People are dogs." ~~~ ## 你看到的結果 ~~~ $ python ex29.py Too many cats! The world is doomed! The world is dry! People are greater than or equal to dogs. People are less than or equal to dogs. People are dogs. ~~~ ## 附加題 猜猜“if語句”是什么,它有什么用處。在做下一道習題前,試著自己回答下面的問題: > 1. 你認為 `if` 對于它下一行的代碼做了什么? > 1. 為什么 `if` 語句的下一行需要縮進? > 1. 如果不縮進,會怎樣? > 1. 把習題 27 中的其它布爾表達式放到`if語句`中能不能運行呢?試一下。 > 1. 如果把變量 `people`, `cats`, 和 `dogs` 的初始值改掉,會怎樣? ## 常見問題 ### Q: `+=`表示什么意思? > 代碼`x += 1`和`x = x + 1` 實現的是一樣的功能,但是可以少輸入一些字符。你可以稱之為“增量”操作符。`-=` 也是相同的,后面你會看到更多的相關解釋。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看