Python3中13種實例彙總

Python3中13種實例彙總

1、Python數字求和

Python3中13種實例彙總

2、平方根√ ̄,例:√ ̄16=4

Python3中13種實例彙總

3、計算三角形面積;注 :三角形面積=(半周長 * (半周長-邊長A) * (半周長-邊長B) * (半周長-邊長C))**0.5

Python3中13種實例彙總

4、生成隨機數

Python3中13種實例彙總

5、判斷奇偶數

Python3中13種實例彙總

6、判斷閏年

Python3中13種實例彙總

7、判斷是不是質數

Python3中13種實例彙總

8、階乘

Python3中13種實例彙總

9、九九乘法表

Python3中13種實例彙總

10、判斷是不是數字【這個得引入庫】

Python3中13種實例彙總

11、Python 十進制轉二進制(bin)、八進制(oct)、十六進制(hex)

Python3中13種實例彙總

12、最大公約數

Python3中13種實例彙總

13、生成日曆

Python3中13種實例彙總




分享到:


相關文章: