各位先进们好, 小废物我目前在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小时想破头也弄不出来