
Python 入門指南 5.0
exercise1002.py
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # 定義兩個數字合的函數 def my_sum(): # 接收使用者輸入 a = input("請輸入第一個數字:") b = input("請輸入第二個數字:") # 回傳計算結果 return int(a) + int(b) # 印出計算結果 print(my_sum()) # 檔名: exercise1002.py # 說明:《Python入門指南》的練習 # 網站: http://kaiching.org # 作者: 張凱慶 # 時間: 2023 年 8 月 |
