Python Scripting : Get max Last Modified Date using os.walk

Below is the code that i have written to get the max Lsat Modified Date of the files in all folders that i can delete all the folders that are not not being used by me for a long time.

import os
import datetime
print “This is console module”
def comparefiletime(in_file,in_date) :
lastdate =datetime.datetime.fromtimestamp(os.path.getmtime(in_file))
if lastdate > in_date:
return lastdate
return in_date

def getmaxdatefolders(in_root_fldr):
for foldern, sfoldern, filen in os.walk(in_root_fldr):
maxdate = datetime.datetime(1900, 1, 1,00,00)
for fileo in filen:
maxdate = comparefiletime(os.path.join(foldern,fileo),maxdate);
printmax date for the folder %s is %s’ %(foldern, maxdate)