The point of the script is to tell you what day of the week it will be after 'X' amount of days from a given day.
I've been learning how to code for a few hours so bear with me.
# Prompt the user for input
print("This scipt is useful in finding out what day of the week it \
will be after 'X' ammount of days in relation to the current date.")
sunday = Sunday = 0
monday = Monday = 1
tuesday = Tuesday = 2
wednesday = Wednesday = 3
thursday = Thursday = 4
friday = Friday = 5
saturday = Saturday = 6
print(" ")
todaysDate = input("Enter todays date: ")
daysFromToday = int(input("Enter a integer for days from today: "))
# Compute equasion
daysFromDate = ((todaysDate + daysFromToday) % 7)
# Display results
print(" ")
print("Today is", todaysDate, "and in", daysFromToday, "days it will be", daysFromDate)
print(" ")
print("Sunday = 0, \
Monday = 1, \
Tuesday = 2, \
Wednesday = 3, \
Thursday = 4, \
Friday = 5, \
Saturday = 6")
input("Press enter to close: ")
My error is
Traceback (most recent call last):
File "C:\Desktop\daysfromdate.py", line 18, in <module>
daysFromDate = ((todaysDate + daysFromToday) % 7)
TypeError: Can't convert 'int' object to str implicitly
I fixed by using
todaysDate = eval(input("Enter todays date: "))
now my script runs fine, but last question is how do I make it answer with the word version of the variables?
Current output is
Today is 0 and in 100 days it will be 2
I would like it to be
Today is Sunday in 100 days it will be Tuesday