Wishing Happy New Year 2022 in Python

Happy New Year in Python

Introduction

A new year brings lots of fun, many promises, a career goal, new hope, and so many things. I'm rewriting this article on 29 Dec 2021. The idea came to mind to wish Happy New Year in a different style like a programmer.

I developed a python program to print Happy New Year on the Terminal or Command-Prompt. The logic of the code is too simple. I hope You'll enjoy this one. Do copy the code and share it with Your friends to wish this new year differently.

Code


import time
from random import randint


for i in range(1,85):
print('')

space = ''


for i in range(1,1000):
count = randint(1, 100)
while(count > 0):
space += ' '
count -= 1

if(i%10==0):
print(space + 'Happy New Year 2022🎉')
elif(i%9 == 0):
print(space + "🪅")
elif(i%5==0):
print(space +"🎈")
elif(i%8==0):
print(space + "🎈")
elif(i%7==0):
print(space + "🍁")
elif(i%6==0):
print(space + "Wish a Covid Free World!")
else:
print(space + "🔸")

space = ''
time.sleep(0.2)

Output

Subhankar Rakshit

Meet Subhankar Rakshit, a Computer Science postgraduate (M.Sc.) and the creator of PySeek. Subhankar is a programmer, specializes in Python language. With a several years of experience under his belt, he has developed a deep understanding of software development. He enjoys writing blogs on various topics related to Computer Science, Python Programming, and Software Development.

Post a Comment (0)
Previous Post Next Post