String to time python in hours and minutes and calculate difference
<p>I am taking time as input from the user in the <code>HH:MM</code> format. Let's say 00:00 and now I want to keep adding a minute to the time and make it 00:01, 00:02 and so on.</p>

<p>Also, I am taking two inputs form the user <code>start_time</code> and <code>end_time</code> as strings. How can I calculate the difference between the two times as well in minutes?</p>

<p>I am new to Python and any help would be appreciated!</p>

<p>I am using the below code:</p>

<pre><code>#to calculate difference in time
time_diff = datetime.strptime(end_time, '%H:%M') - datetime.strptime(start_time, '%H:%M')
minutes = int(time_diff.total_seconds()/60)
print minutes

#to convert string to time format HH:MM
start_time = datetime.strptime(start_time, '%H:%M').time()

#to increment time by 1 minute
start_time = start_time + datetime.timedelta(minutes=1)
</code></pre>

<p>I am not able to increment the <code>start_time</code> using timedelta.</p>