issetequal()是 julia 中的一个内置函数,用于确定两个指定的集合 a 和 b 是否具有相同的元素。
句法:
issetequal(a, b)
参数:
- a:指定首套
- b:指定的第二组。
返回:如果两个集合相等则返回真,否则返回假。示例 1:
Python
# Julia program to illustrate
# the use of issetequal() method
# Getting true if the two sets
# are equal else returns false.
println(issetequal([1, 2], [1, 2, 3]))
println(issetequal([1, 2], [3, 1, 2]))
println(issetequal([2, 2], [1, 2, 2]))
Python
# Julia program to illustrate
# the use of issetequal() method
# Getting true if the two sets
# are equal else returns false.
println(issetequal([1, 2], [1, 2]))
println(issetequal([1, 2], [2, 1]))
println(issetequal([2, 2, 3], [2, 3, 2]))
println(issetequal([1, 2, 3], [3, 1, 2]))
输出:
示例 2:
Python
# Julia program to illustrate
# the use of issetequal() method
# Getting true if the two sets
# are equal else returns false.
println(issetequal([1, 2], [1, 2]))
println(issetequal([1, 2], [2, 1]))
println(issetequal([2, 2, 3], [2, 3, 2]))
println(issetequal([1, 2, 3], [3, 1, 2]))
输出: