<human>:  datetime get last month number.
<bot>: Here is a Python program to datetime get last month number

import datetime

def get_last_month_number(dt):
  """ Return the last month number for the given datetime. """
  return dt.month + dt.day / 31

# Enter the datetime
dt = datetime.datetime(2018, 1, 1)

# Calling the function
print((get_last_month_number(dt)))

#Example Output
# 1.032258064516129

#Remember to inspect code for bugs.