1. 程式人生 > >理解數據類型與數學運算:求和、溫度轉換

理解數據類型與數學運算:求和、溫度轉換

style div 輸入 pan pre 輸入一個數 sum 兩個 求和

a = input(請輸入一個數)
b = input(請輸入第二個數)

sum2=int(a) + int(b)
print(兩個數的和是:{}.format(sum2))

技術分享圖片

a = input(請輸入一個攝氏溫度)

sum2=int(a) * 9/5 +32
print(轉換的華氏溫度是:{}.format(sum2))

技術分享圖片

理解數據類型與數學運算:求和、溫度轉換