Skip to content

Latest commit

 

History

History
27 lines (19 loc) · 376 Bytes

File metadata and controls

27 lines (19 loc) · 376 Bytes

基本概念

  • Python會根據賦予的值,自動宣告型態

相加

  • +:只能相加同一個型別的
  • ,:會有空格

Casting 型態轉換

  • int()
  • float()
  • str()
f = 1.3
a = int(f)
print(a) = 1
num1 = input()  ## 進來的會是字串
num2 = input() ## 進來的會是字串
print(num1+num2)  ## 結果會是字串相加