-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path7-15.py
More file actions
41 lines (35 loc) · 949 Bytes
/
Copy path7-15.py
File metadata and controls
41 lines (35 loc) · 949 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#! /usr/bin/env python
# encoding:utf-8
tmp_1 = eval(raw_input("please input set A,separate by comma:"))
tmp_2 = eval(raw_input("please input set B,separate by comma:"))
A = set(tmp_1)
B = set(tmp_2)
print A
print B
while True:
op = raw_input("please choose a operator from (in,not in,&,|,^,<,<=,>,>=,==,!=)for A operator B:")
if 'in' == op:
print 'A in B is: ',A in B
elif 'not in' ==op:
print 'A not in B is: ',A not in B
elif '&' == op:
print 'A & B is: '.A & B
elif '|' ==op:
print 'A | B is: ',A | B
elif '^' == op:
print 'A ^ B is: '.A ^ B
elif '<' ==op:
print 'A < B is: ',A < B
elif '<=' == op:
print 'A <= B is: ',A <= B
elif '>' ==op:
print 'A > B is: ',A > B
elif '>=' == op:
print 'A >= B is: ',A >= B
elif '==' == op:
print 'A == B is: ',A == B
elif '!=' == op:
print 'A != B is: ',A != B
else:
print 'input error'
break