python中,变量之间赋值后程序结果却不相同,是哪里出了问题

问题遇到的现象和发生背景

程序一中的第二行,把变量list3赋值给temp变量,而程序二中将list3[ : ]赋给变量temp,程序的计算结果却不相同,在第一行将列表赋给变量list3后,再赋给变量temp不可以吗,咋会导致结果错误

问题相关代码,请勿粘贴截图
这是程序一,程序一与程序二对比,第二行不同。
>>> list3 = [1,2,3,4,5,1,2,3]
>>> temp = list3
>>> temp
[1, 2, 3, 4, 5, 1, 2, 3]
>>> list3.clear()
>>> list3
[]
>>> for each in temp:
    if each not in list3:
        list3.append(each)

        
>>> list3
[]
这是程序二,程序一与程序二对比,第二行不同。
>>> list3 = [1,2,3,4,5,1,2,3]
>>> temp = list3[ : ]
>>> temp
[1, 2, 3, 4, 5, 1, 2, 3]
>>> list3.clear()
>>> list3
[]
>>> for each in temp:
    if each not in list3:
        list3.append(each)

>>> list3
[]
运行结果及报错内容
我的解答思路和尝试过的方法
我想要达到的结果

temp = list3
这个是一个引用,temp实际上没有值,只是对list3 的一个引用,改变list3的董事temp也会改变。
temp = list3[:]
这个是把list3 的值完完全全复制一份给temp,list3再变化对temp也没影响。