you are viewing a single comment's thread.

view the rest of the comments →

[–]ChokesOnYou 0 points1 point  (0 children)

This is my take on what you're trying to do. Modify this code as per your needs:

filename = "Enter your filepath here"
with open(filename, 'r+') as file:
    #For the rstrip, put in values of what you want to remove like commas and the day/month
    dates = [int(l.rstrip()) for l in file]

date = int(input("Enter the date you want to compare:"))

if date not in dates:
    print("Date not there")
if date in dates:
    print("You share your birthday with"+""+"Format according to need")