Skip to main content
added 5 characters in body; edited tags
Source Link

I've found some really strange behaviourbehavior in Python. One of my students made some kind of mistake trying to find elements which belong to two lists :, he wrote:

list1 and list2

list1 and list2 

The strange behaviourbehavior is that no error is fired by Python3 Python 3! list1 and list2list1 and list2 actually has got a value which is list2list2.

Is there any known reason for this  ?

I've found some really strange behaviour in Python. One of my students made some kind of mistake trying to find elements which belong to two lists : he wrote

list1 and list2

The strange behaviour is that no error is fired by Python3 ! list1 and list2 actually has got a value which is list2.

Is there any known reason for this  ?

I've found some really strange behavior in Python. One of my students made some kind of mistake trying to find elements which belong to two lists, he wrote:

list1 and list2 

The strange behavior is that no error is fired by Python 3! list1 and list2 actually has got a value which is list2.

Is there any known reason for this?

Source Link

and operator on Python lists

I've found some really strange behaviour in Python. One of my students made some kind of mistake trying to find elements which belong to two lists : he wrote

list1 and list2

The strange behaviour is that no error is fired by Python3 ! list1 and list2 actually has got a value which is list2.

Is there any known reason for this ?