#!/usr/bin/env python days = int(raw_input("Enter days: ")) months = days / 30 days = days % 30 print "Months = %d Days = %d" % (months, days)
[kd@kdlappy book]$ ./integer.py Enter days: 265 Months = 8 Days = 25
#!/usr/bin/env python days = int(raw_input("Enter days: ")) print "Months = %d Days = %d" % (divmod(days, 30))