1. 程式人生 > >python基礎 while循環和練習題

python基礎 while循環和練習題

沒有 雞兔同籠 http ima 基礎 奇數 bubuko mage port

一.上面的題目答案:

1.雞兔同籠:

技術分享圖片

2.百錢買百雞

技術分享圖片

二.

while 條件 :

import time #時間

conut = 0
while conut <= 10:
  print(conut)
  conut = conut + 1

print(123)

題目:

1.使用while循環輸出1 2 3 4 5 6 8 9 10沒有7

2.求1-100的所以數的和

3.輸出1-100內的所以奇數

4.輸出1-100內的所以偶數

5.求1-2+3+4+5.。。99的所有數的和

6.用戶登錄(三次機會重試)

  

python基礎 while循環和練習題