我尝试在for循环后打印在函数内部定义的变量,但是没有打印出来。实际上,我尝试在for循环之后仅打印“ HI”,但没有被打印
def find_sum_delay(slack):
global temp_list
total_delay = 0
unique_temp_list = list(unique_everseen(temp_list))
#print(unique_temp_list)
for cell in unique_temp_list:
if cell.startswith('BUFH_'):
print(temp_list.count(cell),cell, bufh_dict_celltype[cell])
print(temp_list.count(cell) * bufh_dict_celltype[cell])
total_delay = total_delay + (temp_list.count(cell) * bufh_dict_celltype[cell])
print(total_delay)
print('hi')
对于上面的代码,total_delay正在被打印,但是在for循环结束时,hi并非突然被打印。几个小时前它正常工作