Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. def isSubsetArray(ArrayA, ArrayB):
  2. countSameSubset = 0
  3. for i_index in range(len(ArrayB)):
  4. for j_index in range(len(ArrayA)):
  5. if (ArrayA[j_index].strip().upper() == ArrayB[i_index].strip().upper()):
  6. countSameSubset += 1
  7. break
  8.  
  9. if (countSameSubset == len(ArrayB)):
  10. return True
  11. else:
  12. return False
  13.  
  14. def main():
  15. StringA = input("Input the 1st Array : ")
  16. StringB = input("Input the 2nd Array : ")
  17. isSubsetValue = isSubsetArray(StringA.split(','), StringB.split(','))
  18. print('isSubset([',StringB.upper(),'], [', StringA.upper(), ']) = ', str(isSubsetValue))
  19.  
  20. if __name__ == '__main__':
  21. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement