no = ['hello','world','spam','eggs']
yes = ['hey','spaam']
How can I do something like yes=no
?
I want the list "yes" to be exactly like the list "no".
no = ['hello','world','spam','eggs']
yes = ['hey','spaam']
How can I do something like yes=no
?
I want the list "yes" to be exactly like the list "no".
You can do it by:
no = ['hello','world','spam','eggs']
yes = ['hey','spaam']
yes.clear()
yes.extend(no)
This way, instance of yes
will be persevere and extended with the content of no