Python Inserting Variable Interval Definition