Transforming tuple with (int month, int year) in string "mm/yyyy" I would like to improve the following code:

    result = database.execute(script, fetch="0") # (6, 2016) for example
    month = str(result[0])
    year = str(result[1])
    if len(month) == 1:
        month = "0" + month
    return "%s/%s" % (month, year)


I'm feeling that my code is dumb, and could be more intelligent.

Python version 2.6.
You can use the datetime module:

import datetime as dt
result = (2, 2017)
date = dt.date(year=result[1], month=result[0], day=1)
date_str = date.strftime("%m/%Y")