Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

Python Help needed with christmas code

Meerkat

New Coder
so i decided i wanted to make a christmas that tells you how long until christmas and so on but although the rest of the code works, it runs the day variable every time even when it isn't supposed to. Any suggestions would be helpful!

Python:
Month= input("What month is it? ")
if Month == "December" or "december":
    Day = int(input("What day is it? ")
    if Day != 25:
        Sleeps = (25 - Day)
        stuff_in_string = ("It's not christmas yet, only {} sleeps left to go!").format(Sleeps)
        print (stuff_in_string)
       
    elif Day == 26:
        print ("Christmas is over but 5 days till New year!")

    elif Day == 27:
        print ("Christmas is over but 4 days till New year!")
       
    elif Day == 28:
        print ("Christmas is over but 3 days till New year!")

    elif Day == 29:
        print ("Christmas is over but 2 days till New year!")

    elif Day == 30:
        print ("Christmas is over but 1 days till New year!")

    elif Day == 31:
        print ("Christmas is over but it's New Years Eve!")
       
    else:
            print("Merry Christmas Everyone")
            print("I hope you have a lovely day!")
   
elif Month == "January" or "january":
    print ("12 months to go!")
   
elif Month == "February" or "february":
    print ("11 months to go!")
   
elif Month == "March" or "march":
    print ("10 months to go!")
   
elif Month == "April" or "april":
    print ("9 months to go!")
   
elif Month == "May" or "may":
    print ("8 months to go!")
   
elif Month == "June" or "june":
    print ("7 months to go!")
   
elif Month == "July" or "july":
    print ("6 months to go!")
   
elif Month == "August" or "august":
    print ("5 months to go!")
   
elif Month == "September" or "september":
    print ("4 months to go!")
   
elif Month == "October" or "october":
    print ("3 months to go!")
   
else:
    print ("2 months to go!")
 
Last edited:

New Threads

Latest posts

Buy us a coffee!

Back
Top Bottom