def my_function(something): # something => 參數 Parameter: the name of the data that's being passed in
#do this with something
my_function(123) # 123 => 值 Argument: the actual value of the data
■ 10-97. Functions with Outputs
def my_function(something):
result = something * 2 # do this with something
return result
abc = my_function(123)
參考:string method(對語法還不熟時,我覺得 w3schools 中的 string type, string method, list type, list method 應該都開好視窗當參考)
capitalize() - Converts the first character to upper case
title() - Converts the first character of each word to upper case
10-98. Multiple return values
介紹 function 中可以有多個 return
10-99. [Interactive Coding Exercise] Days in Month
沒什麼