365:exit(1)if__name__=="__main__&q"/> 365:exit(1)if__name__=="__main__&q">
<code><p><br>from datetime import datetime<br>import pprint<br><br>pp = pprint.PrettyPrinter()<br><br><br>def Happy_New_year():<br> now = datetime.now()<br> this_year = now.year<br> day = 1<br> while this_year == 2018:<br> pp.pprint("2018年第{}天: 健康,进步!".format(day))<br> day += 1<br> if day > 365:<br> exit(1)<br><br>if __name__ == "__main__":<br> Happy_New_year()<br> <br> <br></p></code>
以上是Java实现新年祝福的方法及示例的详细内容。更多信息请关注PHP中文网其他相关文章!