Home > other >  Py dictionary and collection
Py dictionary and collection

Time:10-09

(3) the topic
Save the children.
Thank you

CodePudding user response:

Yourself to the whole data well, and then such as lei feng, lei feng don't like to knock their data code,

Given the thinking of 1, 3 items code

 

Class_1={' a ', 'b', 'c'}
Class_2={' b ', 'd'}
Class_3={' a ', 'e', 'f'}

Class_all=class_1 | class_2 | class_3

# set collection, the total number of elective courses
Print (len (class_all))


# set collection, choose the number of 3 course
Class_all=class_1 & amp; Class_2 & amp; Class_3

Print (len (class_all))

CodePudding user response:

7 # line that is set and set
11 # line that is set
  • Related