from datetime import date
import random

days_dictionary = {
    1: 31,
    2: 28,
    3: 31,
    4: 30,
    5: 31,
    6: 30,
    7: 31,
    8: 31,
    9: 30,
    10: 31,
    11: 30,
    12: 31,
}

day1 = int(input("Input a day"))
month1 = int(input("Input a month"))
year1 = input("Input a year")
print("user day: " + str(month1) + "/" + str(day1) + "/" + year1)

month2 = random.choice(list(days_dictionary.keys()))
day2Max = days_dictionary.get(month2)
day2 = random.randint(1, day2Max)
print("random day: " + str(month2) + "/" + str(day2) + "/" + year1)


global numDay
numDay = int(days_dictionary.get(month1)) - day1 
for i in range (month1 + 1, month2 + 1): 
    numDay += days_dictionary.get(month1)
    month1 += 1
    
numDay -= (days_dictionary.get(month2) - day2)

print(str(numDay))
    
user day: 1/1/2000
random day: 5/14/2000
133

Note

I just realized that I probably should have used the datetime library. Below is the edited code.

from datetime import date
import datetime 
import random

days_dictionary = {
    1: 31,
    2: 28,
    3: 31,
    4: 30,
    5: 31,
    6: 30,
    7: 31,
    8: 31,
    9: 30,
    10: 31,
    11: 30,
    12: 31,
}

day1 = int(input("Input a day"))
month1 = int(input("Input a month"))
year1 = int(input("Input a year"))
print("user day: " + str(month1) + "/" + str(day1) + "/" + str(year1))

month2 = random.choice(list(days_dictionary.keys()))
day2Max = days_dictionary.get(month2)
day2 = random.randint(1, day2Max)
print("random day: " + str(month2) + "/" + str(day2) + "/" + str(year1))

datetime1 = datetime.datetime(year1, month1, day1)
datetime2 = datetime.datetime(year1, month2, day2)
 
diffDay = str(datetime2 - datetime1)

print("The number of days between the given range of dates is: " + diffDay.partition(",")[0])
 
user day: 1/1/2000
random day: 8/13/2000
The number of days between the given range of dates is: 225 days