You are currently viewing Best christmas greetings using python code
christmas python code for 2021

Best christmas greetings using python code

Spread the love

In this article we will see how to write simple python code to wishing to someone for this merry christmas in 2021.

So Let’s see:

we use three Random wishing quits, when we run this program we got different random output at each time

Merry Christmas in python

import random
def ChooseWord(wordlist) :
	word = random.choice(wordlist)
	return word
def PickRandomNumber(ns) :
	n = random.choice(ns)
	return n

def IWishYou(second, third) :
	noun = ChooseWord(third)
	adjective = ChooseWord(second)
	print("I wish you a " + adjective + " " + noun + ".")

def IHopeTo(fourth, fifth) :
	verb = ChooseWord(fourth)
	adverb = ChooseWord(fifth)
	print("I hope " + verb + " you " + adverb + ".")

def HaveA(second, third) :
	adjective = ChooseWord(second)
	noun = ChooseWord(third)
	print("Have a " + adjective + " " + noun + ".")

def Salutation(first) :
	salutation = ChooseWord(first)
	print(salutation + "!")

def SignOff(endings) :
	end = ChooseWord(endings);

def GenerateChristmasGreeting() :  
	first =  ["Happy Christmas from sach", "Merry Christmas from educational", "Season's Greetings from support", "Happy New Year in advanced from sachin"]
	second=  ["wonderful", "joyous", "peaceful"]
	third =  ["few weeks", "christmas"]
	fourth=  ["to be with", "to meet up with"]
	fifth =  ["soon", "in the new year"]
	endings= ["love with you","All my love"]
	templatesleft = list(range(0,NUMBER_OF_TEMPLATES))
	while len(templatesleft)>0 :
		sentencechoice = PickRandomNumber(templatesleft)
		if (sentencechoice == 0) :
			IWishYou(second, third)
		elif (sentencechoice == 1) :
			IHopeTo(fourth, fifth)
		elif (sentencechoice == 2) :
			HaveA(second, third)
		else :
			print("I'm lost for words")



This below window appear after running this code

christmas code in python
Christmas in python
Christmas image in python
Christmas image in python

sachin Pagar

I am Mr. Sachin pagar Embedded software engineer, the founder of Sach Educational Support(Pythonslearning), a Passionate Educational Blogger and Author, who love to share the informative content on educational resources.

Leave a Reply