<\/span><\/h2>\n\n\n\nYou are given two sets, A<\/em><\/strong> and B<\/em><\/strong>.
Your job is to find whether set A<\/em><\/strong> is a subset of set B<\/em><\/strong>.<\/p>\n\n\n\nIf set A<\/strong><\/em> is subset of set B<\/em><\/strong>, print True<\/strong>.
If set A<\/strong><\/em> is not a subset of set B<\/em><\/strong>, print False<\/strong>.<\/p>\n\n\n\n<\/span>Input Format<\/strong><\/span><\/h2>\n\n\n\nThe first line will contain the number of test cases, T<\/strong><\/em>.
The first line of each test case contains the number of elements in set A<\/em><\/strong>.
The second line of each test case contains the space separated elements of set A<\/em><\/strong>.
The third line of each test case contains the number of elements in set B<\/em><\/strong>.
The fourth line of each test case contains the space separated elements of set B<\/em><\/strong>.<\/p>\n\n\n\n<\/span>Constraints<\/strong><\/span><\/h2>\n\n\n\n- 0 < T<\/em> < 21<\/strong><\/li>
- 0 < Number of elements in each set <\/em>< 1001<\/strong><\/li><\/ul>\n\n\n\n
<\/span>Output Format<\/strong><\/span><\/h2>\n\n\n\nOutput True<\/strong> or False<\/strong> for each test case on separate lines.<\/p>\n\n\n\nSample Input<\/strong><\/p>\n\n\n\n3\n5\n1 2 3 5 6\n9\n9 8 5 6 3 2 1 4 7\n1\n2\n5\n3 6 5 4 1\n7\n1 2 3 5 6 8 9\n3\n9 8 2<\/code><\/pre>\n\n\n\nSample Output<\/strong><\/p>\n\n\n\nTrue \nFalse\nFalse<\/code><\/pre>\n\n\n\nExplanation<\/strong><\/p>\n\n\n\nTest Case 01 Explanation<\/strong><\/p>\n\n\n\nSet A<\/em><\/strong> = {1 2 3 5 6}
Set B<\/strong><\/em> = {9 8 5 6 3 2 1 4 7}
All the elements of set A<\/em><\/strong> are elements of set B<\/strong><\/em>.
Hence, set A<\/em><\/strong> is a subset of set B<\/em><\/strong>.<\/p>\n\n\n\n<\/span>Solution – Check Subset in Python <\/strong><\/span><\/h2>\n\n\n\n# Enter your code here. Read input from STDIN. Print output to STDOUT\nfor i in range(int(input())):\n a = int(input())\n set_a = set(map(int, input().split()))\n\n b = int(input())\n set_b = set(map(int, input().split()))\n\n if len(set_a - set_b) == 0:\n print(\"True\")\n else:\n print(\"False\")<\/pre>\n\n\n\n