Beispiel #1
0
def interactive():
    # This function uses the above code and implements the program specified in question 5.
    main_list = list_interval_assignment()
    new_interval = 1
    while new_interval != 0:
        new_interval = single_interval_assignment()
        main_list = insert(main_list, new_interval)
        print(main_list)
Beispiel #2
0
def interactive():
# This function uses the above code and implements the program specified in question 5.
    main_list = list_interval_assignment()
    new_interval = 1
    while new_interval != 0:  
        new_interval = single_interval_assignment()
        main_list = insert(main_list, new_interval)
        print(main_list)
Beispiel #3
0
 def test_insert(self):
     insert_test_list = [interval('[','1','3',')'), interval('[','7','9',')')]
     insert_test_addition = [interval('[','4','6',']')]
     insert_test_results = [interval('[','1','9',')')]
     
     self.assertEqual(insert(insert_test_list,insert_test_addition),insert_test_result)