Answer the question
In order to leave comments, you need to log in
Why is the set correct under such an expression?
I can not understand why the set is correct with such an expression?
Highlighted in italics.
A={1,2,3,4}
print("Множество A:", A)
B={3,4,5,6}
print("Множество B:", B)
C=A|B #объединение множеств
print("Множество C=A|B:", C)
#объед множ
print("Множество A.union(B):", A.union(B))
print("Множество B.union(A):", B.union(A))
A.update(B)
print("Множество A:", A)
#измен множ В
B=B|{-1,-2,-3}
print("Множество B:", B)
C|={7,8,9}
print("Множество C:", C)
Answer the question
In order to leave comments, you need to log in
B={3,4,5,6}
B=B|{-1,-2,-3}
Print -> Set B: {3, 4, 5, 6, -2, -3, -1} Why is 1,2 missing,
A={1,2,3,4}
B={3,4,5,6}
C=A|B
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question