questions anon wrote:

> I think this should be simple but I can't find the right commands.
> 
> I have a date for each hour for a whole month (and more) and I would like
> to write a loop that prints each date that is different but skips the
> dates that are the same.
> 
> for i in date:
> print i and then skip i until different
> print next i and then skip i until different
> etc.
> 
> 
> Any feedback will be greatly appreciated.

Store the previous date in a variable and then compare it with the current 
date. If the current date differs from the previos one print it and update 
the previous date.



_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to