创建集合a含元素'000001.XSHE', '000002.XSHE', '0

题库2022-08-02  46

问题 创建集合a含元素'000001.XSHE', '000002.XSHE', '000003.XSHE',集合b含元素'000002.XSHE', '000003.XSHE', '000004.XSHE'分别计算a和b的差集,交集,并集,对称差分。

选项

答案

解析 a = {'000001.XSHE', '000002.XSHE', '000003.XSHE'}b = {'000002.XSHE', '000003.XSHE', '000004.XSHE'} print(a-b)print(a|b)print(a&b)print(a^b)
转载请注明原文地址:https://tihaiku.com/congyezige/2425255.html

最新回复(0)