各位先進們好, 小廢物我目前在Coursera上面自學Python,
有個「應該」對各位蠻簡單的練習題(非考試題目)想發問。
In this code, identify the repeated pattern and replace it with a function
called month_days, that receives the name of the month and the number of days
in that month as parameters. Adapt the rest of the code so that the result is
the same. Confirm your results by making a function call with the correct
parameters for both months listed.
# REPLACE THIS STARTER CODE WITH YOUR FUNCTION
june_days = 30
print("June has " + str(june_days) + " days.")
july_days = 31
print("July has " + str(july_days) + " days.")
我的問題:
1.上堂課是教要利用def month_days(這邊我不知道怎麼打)
這個題目不像是在計算, 都是名詞定義...
2.在Python中存在一種函數可以自動call一個月有幾天嗎Q_Q?
一個人搞2小時想破頭也弄不出來