PYTHON: enter the number of days after today for a future day and display the future day of the week
<p>I figured out how to code todays date but i am having trouble finding out how to code the future date, if the future date is larger than the integer 6. In the textbook they entered todays date is 0 so it is Sunday. But for days elapsed since Sunday, they entered 31. The result was "Today is Sunday and the future day is Wednesday". I do not understand how this was coded. This is what I have so far.</p>

<pre><code>todaysDate = eval(input("Enter an interger for today's day of the week from 0 - 6, Sunday is 0 and Saturday is 6."))


if todaysDate == 0:
    print("Today is Sunday")
elif todaysDate == 1:
    print("Today is Monday")
elif todaysDate == 2:
    print("Today is Tuesday")
elif todaysDate == 3:
    print("Today is Wednesday")
elif todaysDate == 4:
    print("Today is Thursday")
elif todaysDate == 5:
    print("Today is Friday")
elif todaysDate == 6:
    print("Today is Saturday")



daysElapsed = eval(input("Enter the number of days elapsed since today:"))

if daysElapsed == 1:
    print("Today is Sunday and the future day is Monday")
</code></pre>

<p>here the <code>(daysElapsed+todaysDate) % 7</code> gives you the value of future day</p>

<pre><code>def future(day):
    if day == 0:
        print("future is Sunday")
    elif day == 1:
        print("future is Monday")
    elif day == 2:
        print("future is Tuesday")
    elif day == 3:
        print("future is Wednesday")
    elif day == 4:
        print("future is Thursday")
    elif day == 5:
        print("future is Friday")
    elif day == 6:
        print("future is Saturday")

todaysDate = int(input("Enter an interger for today's day of the week from 0 - 6, Sunday is 0 and Saturday is 6."))


if todaysDate == 0:    
    print("Today is Sunday")
elif todaysDate == 1:
    print("Today is Monday")
elif todaysDate == 2:
    print("Today is Tuesday")
elif todaysDate == 3:
    print("Today is Wednesday")
elif todaysDate == 4:
    print("Today is Thursday")
elif todaysDate == 5:
    print("Today is Friday")
elif todaysDate == 6:
    print("Today is Saturday")


daysElapsed = int(input("Enter the number of days elapsed since today:"))
future((daysElapsed+todaysDate) % 7)
</code></pre>

python