或用以下方法缩短David的答案:
if 4 <= day <= 20 or 24 <= day <= 30: suffix = "th"else: suffix = ["st", "nd", "rd"][day % 10 - 1]
欢迎分享,转载请注明来源:内存溢出
或用以下方法缩短David的答案:
if 4 <= day <= 20 or 24 <= day <= 30: suffix = "th"else: suffix = ["st", "nd", "rd"][day % 10 - 1]
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)