Make 2 sets out of sequences: Intersection, Union, Difference,,X = set('spa
Make 2 sets out of sequences: Intersection, Union, Difference,,X = set('spa
X = set('spam') Y = set(['h', 'a', 'm']) # Make 2 sets out of sequencesprint X, Y print X & Y # Intersectionprint X | Y # Unionprint X - Y # Difference
相关内容
- Pickling and shelving data,picklingshelving,import cPick
- Demonstrates pickling and shelving data,picklingshelving,import cPi
- File read(n),fileread,f = open(r'c
- Looping Over Characters with read,loopingcharacters,f = open('fi
- Bind Key action: Return,bindaction,from Tkinter
- File write(string),filewritestring,f = open(r'c
- Open a file and read a line,openline,myfile = ope
- Reading one line at a time.,readingline,print '\nRea
- Simple addition program.,simpleaddition,# prompt the
- String formatting: Fifteen and five characters allowed in string,fo
评论关闭