[問題] 1題Python自學遇到的作業練習題不會
各位先進們好, 小廢物我目前在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小時想破頭也弄不出來
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 123.193.212.239 (臺灣)
※ 文章網址: https://www.ptt.cc/bbs/Python/M.1623519787.A.D29.html
→
06/13 01:52,
3年前
, 1F
06/13 01:52, 1F
→
06/13 03:20,
3年前
, 2F
06/13 03:20, 2F
→
06/13 03:36,
3年前
, 3F
06/13 03:36, 3F
→
06/13 03:36,
3年前
, 4F
06/13 03:36, 4F
→
06/13 03:36,
3年前
, 5F
06/13 03:36, 5F
→
06/13 03:36,
3年前
, 6F
06/13 03:36, 6F
→
06/13 03:36,
3年前
, 7F
06/13 03:36, 7F
→
06/13 03:36,
3年前
, 8F
06/13 03:36, 8F
→
06/13 03:36,
3年前
, 9F
06/13 03:36, 9F
→
06/13 03:36,
3年前
, 10F
06/13 03:36, 10F
→
06/13 03:39,
3年前
, 11F
06/13 03:39, 11F
→
06/13 03:39,
3年前
, 12F
06/13 03:39, 12F
→
06/13 03:39,
3年前
, 13F
06/13 03:39, 13F
→
06/13 03:42,
3年前
, 14F
06/13 03:42, 14F
→
06/13 03:42,
3年前
, 15F
06/13 03:42, 15F
→
06/13 03:42,
3年前
, 16F
06/13 03:42, 16F
→
06/13 03:45,
3年前
, 17F
06/13 03:45, 17F
→
06/13 03:45,
3年前
, 18F
06/13 03:45, 18F
→
06/13 12:12,
3年前
, 19F
06/13 12:12, 19F
→
06/13 12:13,
3年前
, 20F
06/13 12:13, 20F
→
06/13 12:13,
3年前
, 21F
06/13 12:13, 21F
→
06/13 14:13,
3年前
, 22F
06/13 14:13, 22F
→
06/13 14:23,
3年前
, 23F
06/13 14:23, 23F
![](https://i.imgur.com/2OICyX7.jpg)
→
06/13 14:24,
3年前
, 24F
06/13 14:24, 24F
→
06/13 18:57,
3年前
, 25F
06/13 18:57, 25F
→
06/15 20:53, , 26F
06/15 20:53, 26F
→
06/15 20:53, , 27F
06/15 20:53, 27F
→
06/15 20:53, , 28F
06/15 20:53, 28F
→
06/15 20:53, , 29F
06/15 20:53, 29F
→
06/22 07:56, , 30F
06/22 07:56, 30F
Python 近期熱門文章
PTT數位生活區 即時熱門文章