If you are doing it for fun I won't change much what you did. What you are missing (as some people pointed out) is the leap year calculation. Also a couple of details:
1) The first prevDays loop should go from month.index(monthA) + 1 to 12. Remember than range() includes the first arg but excludes the second one, as in: [arg1, arg2).
2) You have an extra + 1 on remDays. It shouldn't be there.
3) You are missing the leap year calculation. You can calculate leap years as
def is_leap_year(year):
return (year % 4 == 0 and year % 100 != 0) or year % 400 == 0
so, on your month loops I'd add:
for i in range(month.index(monthA) + 1, 12):
remDays += monthLength[i] + (1 if i == 1 and is_leap_year(yearA) else 0)
and
for i in range(0, month.index(monthB)):
prevDays += monthLength[i] + (1 if i == 1 and is_leap_year(yearB) else 0)
Lastly, you need to add 366 days on leap years instead of 365. So, continuing your loop-style, this would be the year calculation:
yearDays = 0
for year in range(yearA + 1, yearB):
yearDays += 366 if is_leap_year(year) else 365
Note that this last piece would go instead of your round(..) stuff.