I tried to make a datetime object from 6 am to midnight by 30 minutes. And I wrote the fllowing code.
from datetime import datetime, timedelta
dt = datetime(2017,8,14,6,0,0)
lst = []
while dt.hour != 00 or dt.minute != 00:
lst.append(dt)
dt = dt + timedelta(minutes=30)
It gave me the result I want but I noticed I accidentally put 00 instead of 0. It seems like 00 is converted to 0 in Python. I checked the type by using type(). As a result, type(00) and type(0) are both int.
Then is there any difference between both? If no difference, why Python allow this format?