+1

Hi guys I just forgot the difference between using .union and pipe(|) operator in python.please explain there is one difference.

python set operation can be performed in two ways and I recently found the difference while coding a while ago... but now I couldn't recollect it... please explain it is anybody knows it.

10/9/2019 10:07:11 PM

Sanjay Kumar

4 Answers

New Answer

+1

both are the same. You can use either one. See the example: https://code.sololearn.com/c2HWA939kFyy/?ref=app

0

Yeah but I remember I had one difference while using it within functions

0

I did a second example with functions, but there is no difference: https://code.sololearn.com/c1Qk28v1Q5oR/?ref=app

0

Yeah Bro... even I tried all this. ..but trust me there's one difference and I encountered it like a week before or something and I'm not abled to recall it