Untitled

Untitled

OOP = Object Oriented Programming

object .method ()

# type 1 print 的name 沒有存到新的variable 所以name 還是原來的小寫
#python most of the methods doesn't change the value 
name = "willson"
name.upper()
print(name)

# type 2 設另一個name 2 variable 用upper moethod 改為大寫
name = "willson"
name2 = name.upper()
print(name2)

# type3 第2個variable name 已經被upper moethod 改為大寫
name = "willson"
name = name.upper()
print(name)

---------------------------------------------------------

[Running] python -u "d:\\2022_python_全攻略\\16. String Method I"
willson
WILLSON
WILLSON