365:exit(1)if__name__=="__main__&q"/> 365:exit(1)if__name__=="__main__&q">

Home >Java >javaTutorial >Methods and examples of implementing New Year greetings in Java

Methods and examples of implementing New Year greetings in Java

王林
王林forward
2023-04-21 09:40:171016browse
<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>

The above is the detailed content of Methods and examples of implementing New Year greetings in Java. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete