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 42 43 44 45 46 47 48 49 50 51 52 53 54
| # A = {2, 2.2, True, 4 + 3j} # B = {1, 2.2, False, 4 + 3j} # print(A & B) # {1, 2.2, (4+3j)} # print(B & A) # {True, 2.2, (4+3j)} # print(A and B) # {False, 1, 2.2, (4+3j)} # print(B and A) # {True, 2, 2.2, (4+3j)} # print(A | B) # {False, True, 2, 2.2, (4+3j)} # print(B | A) # {False, 1, 2.2, 2, (4+3j)} # print(A or B) # {True, 2, 2.2, (4+3j)} # print(B or A) # {False, 1, 2.2, (4+3j)}
# A = {2, 2.2, True, 4 + 3j, 77,88,99,11,"a"} # B = {1, 2.2, False, 4 + 3j} # print(A & B) # {1, 2.2, (4+3j)} # print(B & A) # {True, 2.2, (4+3j)}
# strs = 'abbacabcabb' # print(strs.strip('ab'))
# count = 0 # def add(): # # global count # count = 1 # add() # print("全局的:", count)
# my_list = [1, 2, 3] # def my_test(): # global my_list # my_list[0] = 11 # my_test() # print("全局的:", my_list)
# my_list = [1, 2, 3] # def my_test(): # global my_list # my_list = [11, 2, 3] # my_test() # print("全局的:", my_list)
# my_list = [1, 2, 3] # def my_test(): # global my_list # my_list.append(11) # my_test() # print("全局的:", my_list)
# print('TO BE' or 'NOT TO BE') # print('TO BE' and 'NOT TO BE')
|