I am writing the following code in Python, I want to accomplish the following using a for condition
if (datetime_obj.hour==7):
hour7.append(a)
if (datetime_obj.hour==8):
hour8.append(a)
if (datetime_obj.hour==9):
hour9.append(a)
if (datetime_obj.hour==10):
hour10.append(a)
if (datetime_obj.hour==11):
hour11.append(a)
if (datetime_obj.hour==12):
hour12.append(a)
if (datetime_obj.hour==13):
hour13.append(a)
if (datetime_obj.hour==14):
hour14.append(a)
if (datetime_obj.hour==15):
hour15.append(a)
hour are empty arrays.