程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

Under what circumstances is Python Y= X- (X-Y) association established

編輯:Python

When x Is not an empty set and y No x Is true when a subset of .

x={
'd','b'}
y={
'a','c'}
print(y!=x-(x-y))

Output :

True

y yes x A subset of :

x={
'a','c','d'}
y={
'a','c'}
print(y!=x-(x-y))

Output :

False

Non empty sets are easy to understand , The result of two empty sets calculation is still an empty set , So it will be True.

Note that floating-point errors do not cause inequality , Because the error is consistent , Some words will be subtracted at the same time .


  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved