incomplete datetime conversion : <p>I'm trying to write a function to get the month, hour and day of the week from dictionaries depends on cities information (NYC, Chicago, Washington), the problem I'm facing is that only Washington city date shows and when I try to display other cities it keeps displaying Washington city date</p>

<p>Here is the function:</p>

<pre><code>from datetime import datetime

def time_of_trip(datum, city):

    for x in datum:

        if city == "NYC":
            timeformatted = datetime.strptime(str(datum[x]), "(%m, %H, '%A')")
        elif city == "Chicago":
            timeformatted = datetime.strptime(str(datum[x]), "(%m, %H, '%A')")
        elif city == "Washington":
            timeformatted = datetime.strptime(str(datum[x]), "(%m, %H, '%A')")


    month = datetime.strftime(timeformatted, "%m")
    hour = datetime.strftime(timeformatted, "%H")
    day_of_week = datetime.strftime(timeformatted, "%A")


    return (month, hour, day_of_week)


tests = {'NYC': (1, 0, 'Friday'),
         'Chicago': (3, 21, 'Thursday'),
         'Washington': (3, 22, 'Thursday')}


time_of_trip(tests, "NYC")
</code></pre>
