| { | |
| "language": "python", | |
| "category": "comprehensive", | |
| "training_data": [ | |
| { | |
| "input": "set operations (variation 0)", | |
| "output": "s1 = {1, 2, 3}\ns2 = {3, 4, 5}\nprint(s1 & s2)", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "dictionary creation (variation 1)", | |
| "output": "person = {'name': 'John', 'age': 30}", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "find max in list (variation 2)", | |
| "output": "nums = [3, 7, 2, 9]\nprint(max(nums))", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "loop through list (variation 3)", | |
| "output": "for item in [1, 2, 3]:\n print(item)", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "hello world (variation 4)", | |
| "output": "print('Hello, World!')", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "check if even (variation 5)", | |
| "output": "def is_even(n):\n return n % 2 == 0", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "create list (variation 6)", | |
| "output": "my_list = [1, 2, 3, 4, 5]", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "string formatting (variation 7)", | |
| "output": "name = 'Alice'\nprint(f'Hello {name}')", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "check if even (variation 8)", | |
| "output": "def is_even(n):\n return n % 2 == 0", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "check type (variation 9)", | |
| "output": "x = 42\nprint(type(x))", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "create list (variation 10)", | |
| "output": "my_list = [1, 2, 3, 4, 5]", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "hello world (variation 11)", | |
| "output": "print('Hello, World!')", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "list comprehension (variation 12)", | |
| "output": "squares = [x**2 for x in range(5)]", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "dictionary creation (variation 13)", | |
| "output": "person = {'name': 'John', 'age': 30}", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "find max in list (variation 14)", | |
| "output": "nums = [3, 7, 2, 9]\nprint(max(nums))", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "if else statement (variation 15)", | |
| "output": "x = 10\nif x > 5:\n print('Greater')\nelse:\n print('Lesser')", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "if else statement (variation 16)", | |
| "output": "x = 10\nif x > 5:\n print('Greater')\nelse:\n print('Lesser')", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "dictionary creation (variation 17)", | |
| "output": "person = {'name': 'John', 'age': 30}", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "lambda function (variation 18)", | |
| "output": "square = lambda x: x**2\nprint(square(5))", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "loop through list (variation 19)", | |
| "output": "for item in [1, 2, 3]:\n print(item)", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "list comprehension (variation 20)", | |
| "output": "squares = [x**2 for x in range(5)]", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "loop through list (variation 21)", | |
| "output": "for item in [1, 2, 3]:\n print(item)", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "find max in list (variation 22)", | |
| "output": "nums = [3, 7, 2, 9]\nprint(max(nums))", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "check type (variation 23)", | |
| "output": "x = 42\nprint(type(x))", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "slice list (variation 24)", | |
| "output": "lst = [0, 1, 2, 3, 4]\nprint(lst[1:4])", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "loop through list (variation 25)", | |
| "output": "for item in [1, 2, 3]:\n print(item)", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "hello world (variation 26)", | |
| "output": "print('Hello, World!')", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "check type (variation 27)", | |
| "output": "x = 42\nprint(type(x))", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "find max in list (variation 28)", | |
| "output": "nums = [3, 7, 2, 9]\nprint(max(nums))", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "set operations (variation 29)", | |
| "output": "s1 = {1, 2, 3}\ns2 = {3, 4, 5}\nprint(s1 & s2)", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "check if even (variation 30)", | |
| "output": "def is_even(n):\n return n % 2 == 0", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "lambda function (variation 31)", | |
| "output": "square = lambda x: x**2\nprint(square(5))", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "dictionary creation (variation 32)", | |
| "output": "person = {'name': 'John', 'age': 30}", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "check if even (variation 33)", | |
| "output": "def is_even(n):\n return n % 2 == 0", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "print numbers 1 to 10 (variation 34)", | |
| "output": "for i in range(1, 11):\n print(i)", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "string reverse (variation 35)", | |
| "output": "s = 'hello'\nprint(s[::-1])", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "check type (variation 36)", | |
| "output": "x = 42\nprint(type(x))", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "dictionary creation (variation 37)", | |
| "output": "person = {'name': 'John', 'age': 30}", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "add two numbers function (variation 38)", | |
| "output": "def add(a, b):\n return a + b", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "while loop (variation 39)", | |
| "output": "i = 0\nwhile i < 5:\n print(i)\n i += 1", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "create tuple (variation 40)", | |
| "output": "coords = (10, 20)", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "string formatting (variation 41)", | |
| "output": "name = 'Alice'\nprint(f'Hello {name}')", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "if else statement (variation 42)", | |
| "output": "x = 10\nif x > 5:\n print('Greater')\nelse:\n print('Lesser')", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "add two numbers function (variation 43)", | |
| "output": "def add(a, b):\n return a + b", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "loop through list (variation 44)", | |
| "output": "for item in [1, 2, 3]:\n print(item)", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "lambda function (variation 45)", | |
| "output": "square = lambda x: x**2\nprint(square(5))", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "hello world (variation 46)", | |
| "output": "print('Hello, World!')", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "hello world (variation 47)", | |
| "output": "print('Hello, World!')", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "print numbers 1 to 10 (variation 48)", | |
| "output": "for i in range(1, 11):\n print(i)", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "loop through list (variation 49)", | |
| "output": "for item in [1, 2, 3]:\n print(item)", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "loop through list (variation 50)", | |
| "output": "for item in [1, 2, 3]:\n print(item)", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "slice list (variation 51)", | |
| "output": "lst = [0, 1, 2, 3, 4]\nprint(lst[1:4])", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "dictionary loop (variation 52)", | |
| "output": "d = {'a': 1, 'b': 2}\nfor k, v in d.items():\n print(k, v)", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "if else statement (variation 53)", | |
| "output": "x = 10\nif x > 5:\n print('Greater')\nelse:\n print('Lesser')", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "string formatting (variation 54)", | |
| "output": "name = 'Alice'\nprint(f'Hello {name}')", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "dictionary loop (variation 55)", | |
| "output": "d = {'a': 1, 'b': 2}\nfor k, v in d.items():\n print(k, v)", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "add two numbers function (variation 56)", | |
| "output": "def add(a, b):\n return a + b", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "list comprehension (variation 57)", | |
| "output": "squares = [x**2 for x in range(5)]", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "dictionary loop (variation 58)", | |
| "output": "d = {'a': 1, 'b': 2}\nfor k, v in d.items():\n print(k, v)", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "while loop (variation 59)", | |
| "output": "i = 0\nwhile i < 5:\n print(i)\n i += 1", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "find max in list (variation 60)", | |
| "output": "nums = [3, 7, 2, 9]\nprint(max(nums))", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "list comprehension (variation 61)", | |
| "output": "squares = [x**2 for x in range(5)]", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "while loop (variation 62)", | |
| "output": "i = 0\nwhile i < 5:\n print(i)\n i += 1", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "find max in list (variation 63)", | |
| "output": "nums = [3, 7, 2, 9]\nprint(max(nums))", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "loop through list (variation 64)", | |
| "output": "for item in [1, 2, 3]:\n print(item)", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "find max in list (variation 65)", | |
| "output": "nums = [3, 7, 2, 9]\nprint(max(nums))", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "check type (variation 66)", | |
| "output": "x = 42\nprint(type(x))", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "check if even (variation 67)", | |
| "output": "def is_even(n):\n return n % 2 == 0", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "hello world (variation 68)", | |
| "output": "print('Hello, World!')", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "add two numbers function (variation 69)", | |
| "output": "def add(a, b):\n return a + b", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "lambda function (variation 70)", | |
| "output": "square = lambda x: x**2\nprint(square(5))", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "find max in list (variation 71)", | |
| "output": "nums = [3, 7, 2, 9]\nprint(max(nums))", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "check if even (variation 72)", | |
| "output": "def is_even(n):\n return n % 2 == 0", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "list comprehension (variation 73)", | |
| "output": "squares = [x**2 for x in range(5)]", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "dictionary loop (variation 74)", | |
| "output": "d = {'a': 1, 'b': 2}\nfor k, v in d.items():\n print(k, v)", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "check type (variation 75)", | |
| "output": "x = 42\nprint(type(x))", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "set operations (variation 76)", | |
| "output": "s1 = {1, 2, 3}\ns2 = {3, 4, 5}\nprint(s1 & s2)", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "hello world (variation 77)", | |
| "output": "print('Hello, World!')", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "set operations (variation 78)", | |
| "output": "s1 = {1, 2, 3}\ns2 = {3, 4, 5}\nprint(s1 & s2)", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "check if even (variation 79)", | |
| "output": "def is_even(n):\n return n % 2 == 0", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "while loop (variation 80)", | |
| "output": "i = 0\nwhile i < 5:\n print(i)\n i += 1", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "dictionary creation (variation 81)", | |
| "output": "person = {'name': 'John', 'age': 30}", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "hello world (variation 82)", | |
| "output": "print('Hello, World!')", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "slice list (variation 83)", | |
| "output": "lst = [0, 1, 2, 3, 4]\nprint(lst[1:4])", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "string reverse (variation 84)", | |
| "output": "s = 'hello'\nprint(s[::-1])", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "check if even (variation 85)", | |
| "output": "def is_even(n):\n return n % 2 == 0", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "dictionary loop (variation 86)", | |
| "output": "d = {'a': 1, 'b': 2}\nfor k, v in d.items():\n print(k, v)", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "loop through list (variation 87)", | |
| "output": "for item in [1, 2, 3]:\n print(item)", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "string reverse (variation 88)", | |
| "output": "s = 'hello'\nprint(s[::-1])", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "string formatting (variation 89)", | |
| "output": "name = 'Alice'\nprint(f'Hello {name}')", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "add two numbers function (variation 90)", | |
| "output": "def add(a, b):\n return a + b", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "if else statement (variation 91)", | |
| "output": "x = 10\nif x > 5:\n print('Greater')\nelse:\n print('Lesser')", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "loop through list (variation 92)", | |
| "output": "for item in [1, 2, 3]:\n print(item)", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "create tuple (variation 93)", | |
| "output": "coords = (10, 20)", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "create tuple (variation 94)", | |
| "output": "coords = (10, 20)", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "loop through list (variation 95)", | |
| "output": "for item in [1, 2, 3]:\n print(item)", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "hello world (variation 96)", | |
| "output": "print('Hello, World!')", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "hello world (variation 97)", | |
| "output": "print('Hello, World!')", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "string formatting (variation 98)", | |
| "output": "name = 'Alice'\nprint(f'Hello {name}')", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "dictionary creation (variation 99)", | |
| "output": "person = {'name': 'John', 'age': 30}", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "string formatting (variation 100)", | |
| "output": "name = 'Alice'\nprint(f'Hello {name}')", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "slice list (variation 101)", | |
| "output": "lst = [0, 1, 2, 3, 4]\nprint(lst[1:4])", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "string split (variation 102)", | |
| "output": "text = 'a,b,c'\nparts = text.split(',')\nprint(parts)", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "list comprehension (variation 103)", | |
| "output": "squares = [x**2 for x in range(5)]", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "list comprehension (variation 104)", | |
| "output": "squares = [x**2 for x in range(5)]", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "string split (variation 105)", | |
| "output": "text = 'a,b,c'\nparts = text.split(',')\nprint(parts)", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "list comprehension (variation 106)", | |
| "output": "squares = [x**2 for x in range(5)]", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "print numbers 1 to 10 (variation 107)", | |
| "output": "for i in range(1, 11):\n print(i)", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "dictionary loop (variation 108)", | |
| "output": "d = {'a': 1, 'b': 2}\nfor k, v in d.items():\n print(k, v)", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "hello world (variation 109)", | |
| "output": "print('Hello, World!')", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "hello world (variation 110)", | |
| "output": "print('Hello, World!')", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "check if even (variation 111)", | |
| "output": "def is_even(n):\n return n % 2 == 0", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "dictionary loop (variation 112)", | |
| "output": "d = {'a': 1, 'b': 2}\nfor k, v in d.items():\n print(k, v)", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "while loop (variation 113)", | |
| "output": "i = 0\nwhile i < 5:\n print(i)\n i += 1", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "lambda function (variation 114)", | |
| "output": "square = lambda x: x**2\nprint(square(5))", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "lambda function (variation 115)", | |
| "output": "square = lambda x: x**2\nprint(square(5))", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "list comprehension (variation 116)", | |
| "output": "squares = [x**2 for x in range(5)]", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "if else statement (variation 117)", | |
| "output": "x = 10\nif x > 5:\n print('Greater')\nelse:\n print('Lesser')", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "check type (variation 118)", | |
| "output": "x = 42\nprint(type(x))", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "while loop (variation 119)", | |
| "output": "i = 0\nwhile i < 5:\n print(i)\n i += 1", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "create list (variation 120)", | |
| "output": "my_list = [1, 2, 3, 4, 5]", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "print numbers 1 to 10 (variation 121)", | |
| "output": "for i in range(1, 11):\n print(i)", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "find max in list (variation 122)", | |
| "output": "nums = [3, 7, 2, 9]\nprint(max(nums))", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "string formatting (variation 123)", | |
| "output": "name = 'Alice'\nprint(f'Hello {name}')", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "list comprehension (variation 124)", | |
| "output": "squares = [x**2 for x in range(5)]", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "string formatting (variation 125)", | |
| "output": "name = 'Alice'\nprint(f'Hello {name}')", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "add two numbers function (variation 126)", | |
| "output": "def add(a, b):\n return a + b", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "list comprehension (variation 127)", | |
| "output": "squares = [x**2 for x in range(5)]", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "check type (variation 128)", | |
| "output": "x = 42\nprint(type(x))", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "lambda function (variation 129)", | |
| "output": "square = lambda x: x**2\nprint(square(5))", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "check if even (variation 130)", | |
| "output": "def is_even(n):\n return n % 2 == 0", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "dictionary loop (variation 131)", | |
| "output": "d = {'a': 1, 'b': 2}\nfor k, v in d.items():\n print(k, v)", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "dictionary creation (variation 132)", | |
| "output": "person = {'name': 'John', 'age': 30}", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "dictionary loop (variation 133)", | |
| "output": "d = {'a': 1, 'b': 2}\nfor k, v in d.items():\n print(k, v)", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "check type (variation 134)", | |
| "output": "x = 42\nprint(type(x))", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "find max in list (variation 135)", | |
| "output": "nums = [3, 7, 2, 9]\nprint(max(nums))", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "string formatting (variation 136)", | |
| "output": "name = 'Alice'\nprint(f'Hello {name}')", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "lambda function (variation 137)", | |
| "output": "square = lambda x: x**2\nprint(square(5))", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "loop through list (variation 138)", | |
| "output": "for item in [1, 2, 3]:\n print(item)", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "string split (variation 139)", | |
| "output": "text = 'a,b,c'\nparts = text.split(',')\nprint(parts)", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "loop through list (variation 140)", | |
| "output": "for item in [1, 2, 3]:\n print(item)", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "dictionary loop (variation 141)", | |
| "output": "d = {'a': 1, 'b': 2}\nfor k, v in d.items():\n print(k, v)", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "lambda function (variation 142)", | |
| "output": "square = lambda x: x**2\nprint(square(5))", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "string formatting (variation 143)", | |
| "output": "name = 'Alice'\nprint(f'Hello {name}')", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "check if even (variation 144)", | |
| "output": "def is_even(n):\n return n % 2 == 0", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "dictionary loop (variation 145)", | |
| "output": "d = {'a': 1, 'b': 2}\nfor k, v in d.items():\n print(k, v)", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "dictionary loop (variation 146)", | |
| "output": "d = {'a': 1, 'b': 2}\nfor k, v in d.items():\n print(k, v)", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "lambda function (variation 147)", | |
| "output": "square = lambda x: x**2\nprint(square(5))", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "while loop (variation 148)", | |
| "output": "i = 0\nwhile i < 5:\n print(i)\n i += 1", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "loop through list (variation 149)", | |
| "output": "for item in [1, 2, 3]:\n print(item)", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "while loop (variation 150)", | |
| "output": "i = 0\nwhile i < 5:\n print(i)\n i += 1", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "create tuple (variation 151)", | |
| "output": "coords = (10, 20)", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "string split (variation 152)", | |
| "output": "text = 'a,b,c'\nparts = text.split(',')\nprint(parts)", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "lambda function (variation 153)", | |
| "output": "square = lambda x: x**2\nprint(square(5))", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "hello world (variation 154)", | |
| "output": "print('Hello, World!')", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "create list (variation 155)", | |
| "output": "my_list = [1, 2, 3, 4, 5]", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "dictionary creation (variation 156)", | |
| "output": "person = {'name': 'John', 'age': 30}", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "if else statement (variation 157)", | |
| "output": "x = 10\nif x > 5:\n print('Greater')\nelse:\n print('Lesser')", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "dictionary loop (variation 158)", | |
| "output": "d = {'a': 1, 'b': 2}\nfor k, v in d.items():\n print(k, v)", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "dictionary loop (variation 159)", | |
| "output": "d = {'a': 1, 'b': 2}\nfor k, v in d.items():\n print(k, v)", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "check type (variation 160)", | |
| "output": "x = 42\nprint(type(x))", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "find max in list (variation 161)", | |
| "output": "nums = [3, 7, 2, 9]\nprint(max(nums))", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "set operations (variation 162)", | |
| "output": "s1 = {1, 2, 3}\ns2 = {3, 4, 5}\nprint(s1 & s2)", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "set operations (variation 163)", | |
| "output": "s1 = {1, 2, 3}\ns2 = {3, 4, 5}\nprint(s1 & s2)", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "loop through list (variation 164)", | |
| "output": "for item in [1, 2, 3]:\n print(item)", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "hello world (variation 165)", | |
| "output": "print('Hello, World!')", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "add two numbers function (variation 166)", | |
| "output": "def add(a, b):\n return a + b", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "while loop (variation 167)", | |
| "output": "i = 0\nwhile i < 5:\n print(i)\n i += 1", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "check type (variation 168)", | |
| "output": "x = 42\nprint(type(x))", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "string split (variation 169)", | |
| "output": "text = 'a,b,c'\nparts = text.split(',')\nprint(parts)", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "if else statement (variation 170)", | |
| "output": "x = 10\nif x > 5:\n print('Greater')\nelse:\n print('Lesser')", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "dictionary creation (variation 171)", | |
| "output": "person = {'name': 'John', 'age': 30}", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "check type (variation 172)", | |
| "output": "x = 42\nprint(type(x))", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "dictionary creation (variation 173)", | |
| "output": "person = {'name': 'John', 'age': 30}", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "hello world (variation 174)", | |
| "output": "print('Hello, World!')", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "dictionary creation (variation 175)", | |
| "output": "person = {'name': 'John', 'age': 30}", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "list comprehension (variation 176)", | |
| "output": "squares = [x**2 for x in range(5)]", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "hello world (variation 177)", | |
| "output": "print('Hello, World!')", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "check if even (variation 178)", | |
| "output": "def is_even(n):\n return n % 2 == 0", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "string formatting (variation 179)", | |
| "output": "name = 'Alice'\nprint(f'Hello {name}')", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "while loop (variation 180)", | |
| "output": "i = 0\nwhile i < 5:\n print(i)\n i += 1", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "create tuple (variation 181)", | |
| "output": "coords = (10, 20)", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "dictionary creation (variation 182)", | |
| "output": "person = {'name': 'John', 'age': 30}", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "check if even (variation 183)", | |
| "output": "def is_even(n):\n return n % 2 == 0", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "lambda function (variation 184)", | |
| "output": "square = lambda x: x**2\nprint(square(5))", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "lambda function (variation 185)", | |
| "output": "square = lambda x: x**2\nprint(square(5))", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "create tuple (variation 186)", | |
| "output": "coords = (10, 20)", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "string reverse (variation 187)", | |
| "output": "s = 'hello'\nprint(s[::-1])", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "lambda function (variation 188)", | |
| "output": "square = lambda x: x**2\nprint(square(5))", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "create list (variation 189)", | |
| "output": "my_list = [1, 2, 3, 4, 5]", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "string formatting (variation 190)", | |
| "output": "name = 'Alice'\nprint(f'Hello {name}')", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "create tuple (variation 191)", | |
| "output": "coords = (10, 20)", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "loop through list (variation 192)", | |
| "output": "for item in [1, 2, 3]:\n print(item)", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "check if even (variation 193)", | |
| "output": "def is_even(n):\n return n % 2 == 0", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "while loop (variation 194)", | |
| "output": "i = 0\nwhile i < 5:\n print(i)\n i += 1", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "string split (variation 195)", | |
| "output": "text = 'a,b,c'\nparts = text.split(',')\nprint(parts)", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "find max in list (variation 196)", | |
| "output": "nums = [3, 7, 2, 9]\nprint(max(nums))", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "check if even (variation 197)", | |
| "output": "def is_even(n):\n return n % 2 == 0", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "check type (variation 198)", | |
| "output": "x = 42\nprint(type(x))", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "string formatting (variation 199)", | |
| "output": "name = 'Alice'\nprint(f'Hello {name}')", | |
| "tags": [ | |
| "basics", | |
| "beginner" | |
| ] | |
| }, | |
| { | |
| "input": "is prime function (variant 0)", | |
| "output": "def is_prime(n):\n if n < 2: return False\n for i in range(2, n):\n if n % i == 0: return False\n return True", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "count chars function (variant 1)", | |
| "output": "def count_chars(s):\n return len(s)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "factorial function (variant 2)", | |
| "output": "def factorial(n):\n return 1 if n <= 1 else n * factorial(n-1)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "merge lists function (variant 3)", | |
| "output": "def merge_lists(l1, l2):\n return l1 + l2", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "reverse string function (variant 4)", | |
| "output": "def reverse(s):\n return s[::-1]", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "filter odd function (variant 5)", | |
| "output": "def filter_odd(lst):\n return [x for x in lst if x % 2 != 0]", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "factorial function (variant 6)", | |
| "output": "def factorial(n):\n return 1 if n <= 1 else n * factorial(n-1)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "factorial function (variant 7)", | |
| "output": "def factorial(n):\n return 1 if n <= 1 else n * factorial(n-1)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "merge lists function (variant 8)", | |
| "output": "def merge_lists(l1, l2):\n return l1 + l2", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "merge lists function (variant 9)", | |
| "output": "def merge_lists(l1, l2):\n return l1 + l2", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "factorial function (variant 10)", | |
| "output": "def factorial(n):\n return 1 if n <= 1 else n * factorial(n-1)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "sum list function (variant 11)", | |
| "output": "def sum_list(lst):\n total = 0\n for num in lst:\n total += num\n return total", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "sum list function (variant 12)", | |
| "output": "def sum_list(lst):\n total = 0\n for num in lst:\n total += num\n return total", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "count chars function (variant 13)", | |
| "output": "def count_chars(s):\n return len(s)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "is prime function (variant 14)", | |
| "output": "def is_prime(n):\n if n < 2: return False\n for i in range(2, n):\n if n % i == 0: return False\n return True", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "sum list function (variant 15)", | |
| "output": "def sum_list(lst):\n total = 0\n for num in lst:\n total += num\n return total", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "remove duplicates function (variant 16)", | |
| "output": "def remove_dups(lst):\n return list(set(lst))", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "sum list function (variant 17)", | |
| "output": "def sum_list(lst):\n total = 0\n for num in lst:\n total += num\n return total", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "factorial function (variant 18)", | |
| "output": "def factorial(n):\n return 1 if n <= 1 else n * factorial(n-1)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "count chars function (variant 19)", | |
| "output": "def count_chars(s):\n return len(s)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "find min max function (variant 20)", | |
| "output": "def find_range(lst):\n return (min(lst), max(lst))", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "remove duplicates function (variant 21)", | |
| "output": "def remove_dups(lst):\n return list(set(lst))", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "count chars function (variant 22)", | |
| "output": "def count_chars(s):\n return len(s)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "is prime function (variant 23)", | |
| "output": "def is_prime(n):\n if n < 2: return False\n for i in range(2, n):\n if n % i == 0: return False\n return True", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "remove duplicates function (variant 24)", | |
| "output": "def remove_dups(lst):\n return list(set(lst))", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "count chars function (variant 25)", | |
| "output": "def count_chars(s):\n return len(s)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "factorial function (variant 26)", | |
| "output": "def factorial(n):\n return 1 if n <= 1 else n * factorial(n-1)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "find min max function (variant 27)", | |
| "output": "def find_range(lst):\n return (min(lst), max(lst))", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "remove duplicates function (variant 28)", | |
| "output": "def remove_dups(lst):\n return list(set(lst))", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "reverse string function (variant 29)", | |
| "output": "def reverse(s):\n return s[::-1]", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "factorial function (variant 30)", | |
| "output": "def factorial(n):\n return 1 if n <= 1 else n * factorial(n-1)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "find min max function (variant 31)", | |
| "output": "def find_range(lst):\n return (min(lst), max(lst))", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "is prime function (variant 32)", | |
| "output": "def is_prime(n):\n if n < 2: return False\n for i in range(2, n):\n if n % i == 0: return False\n return True", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "remove duplicates function (variant 33)", | |
| "output": "def remove_dups(lst):\n return list(set(lst))", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "remove duplicates function (variant 34)", | |
| "output": "def remove_dups(lst):\n return list(set(lst))", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "sum list function (variant 35)", | |
| "output": "def sum_list(lst):\n total = 0\n for num in lst:\n total += num\n return total", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "merge lists function (variant 36)", | |
| "output": "def merge_lists(l1, l2):\n return l1 + l2", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "fibonacci function (variant 37)", | |
| "output": "def fib(n):\n if n <= 1: return n\n return fib(n-1) + fib(n-2)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "find min max function (variant 38)", | |
| "output": "def find_range(lst):\n return (min(lst), max(lst))", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "reverse string function (variant 39)", | |
| "output": "def reverse(s):\n return s[::-1]", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "remove duplicates function (variant 40)", | |
| "output": "def remove_dups(lst):\n return list(set(lst))", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "find min max function (variant 41)", | |
| "output": "def find_range(lst):\n return (min(lst), max(lst))", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "remove duplicates function (variant 42)", | |
| "output": "def remove_dups(lst):\n return list(set(lst))", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "remove duplicates function (variant 43)", | |
| "output": "def remove_dups(lst):\n return list(set(lst))", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "sum list function (variant 44)", | |
| "output": "def sum_list(lst):\n total = 0\n for num in lst:\n total += num\n return total", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "count chars function (variant 45)", | |
| "output": "def count_chars(s):\n return len(s)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "remove duplicates function (variant 46)", | |
| "output": "def remove_dups(lst):\n return list(set(lst))", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "remove duplicates function (variant 47)", | |
| "output": "def remove_dups(lst):\n return list(set(lst))", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "fibonacci function (variant 48)", | |
| "output": "def fib(n):\n if n <= 1: return n\n return fib(n-1) + fib(n-2)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "remove duplicates function (variant 49)", | |
| "output": "def remove_dups(lst):\n return list(set(lst))", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "is prime function (variant 50)", | |
| "output": "def is_prime(n):\n if n < 2: return False\n for i in range(2, n):\n if n % i == 0: return False\n return True", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "remove duplicates function (variant 51)", | |
| "output": "def remove_dups(lst):\n return list(set(lst))", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "sum list function (variant 52)", | |
| "output": "def sum_list(lst):\n total = 0\n for num in lst:\n total += num\n return total", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "merge lists function (variant 53)", | |
| "output": "def merge_lists(l1, l2):\n return l1 + l2", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "factorial function (variant 54)", | |
| "output": "def factorial(n):\n return 1 if n <= 1 else n * factorial(n-1)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "fibonacci function (variant 55)", | |
| "output": "def fib(n):\n if n <= 1: return n\n return fib(n-1) + fib(n-2)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "remove duplicates function (variant 56)", | |
| "output": "def remove_dups(lst):\n return list(set(lst))", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "is prime function (variant 57)", | |
| "output": "def is_prime(n):\n if n < 2: return False\n for i in range(2, n):\n if n % i == 0: return False\n return True", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "merge lists function (variant 58)", | |
| "output": "def merge_lists(l1, l2):\n return l1 + l2", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "find min max function (variant 59)", | |
| "output": "def find_range(lst):\n return (min(lst), max(lst))", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "count chars function (variant 60)", | |
| "output": "def count_chars(s):\n return len(s)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "merge lists function (variant 61)", | |
| "output": "def merge_lists(l1, l2):\n return l1 + l2", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "filter odd function (variant 62)", | |
| "output": "def filter_odd(lst):\n return [x for x in lst if x % 2 != 0]", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "find min max function (variant 63)", | |
| "output": "def find_range(lst):\n return (min(lst), max(lst))", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "remove duplicates function (variant 64)", | |
| "output": "def remove_dups(lst):\n return list(set(lst))", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "remove duplicates function (variant 65)", | |
| "output": "def remove_dups(lst):\n return list(set(lst))", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "find min max function (variant 66)", | |
| "output": "def find_range(lst):\n return (min(lst), max(lst))", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "sum list function (variant 67)", | |
| "output": "def sum_list(lst):\n total = 0\n for num in lst:\n total += num\n return total", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "find min max function (variant 68)", | |
| "output": "def find_range(lst):\n return (min(lst), max(lst))", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "count chars function (variant 69)", | |
| "output": "def count_chars(s):\n return len(s)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "factorial function (variant 70)", | |
| "output": "def factorial(n):\n return 1 if n <= 1 else n * factorial(n-1)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "factorial function (variant 71)", | |
| "output": "def factorial(n):\n return 1 if n <= 1 else n * factorial(n-1)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "factorial function (variant 72)", | |
| "output": "def factorial(n):\n return 1 if n <= 1 else n * factorial(n-1)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "remove duplicates function (variant 73)", | |
| "output": "def remove_dups(lst):\n return list(set(lst))", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "filter odd function (variant 74)", | |
| "output": "def filter_odd(lst):\n return [x for x in lst if x % 2 != 0]", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "factorial function (variant 75)", | |
| "output": "def factorial(n):\n return 1 if n <= 1 else n * factorial(n-1)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "factorial function (variant 76)", | |
| "output": "def factorial(n):\n return 1 if n <= 1 else n * factorial(n-1)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "filter odd function (variant 77)", | |
| "output": "def filter_odd(lst):\n return [x for x in lst if x % 2 != 0]", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "sum list function (variant 78)", | |
| "output": "def sum_list(lst):\n total = 0\n for num in lst:\n total += num\n return total", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "factorial function (variant 79)", | |
| "output": "def factorial(n):\n return 1 if n <= 1 else n * factorial(n-1)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "reverse string function (variant 80)", | |
| "output": "def reverse(s):\n return s[::-1]", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "factorial function (variant 81)", | |
| "output": "def factorial(n):\n return 1 if n <= 1 else n * factorial(n-1)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "remove duplicates function (variant 82)", | |
| "output": "def remove_dups(lst):\n return list(set(lst))", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "reverse string function (variant 83)", | |
| "output": "def reverse(s):\n return s[::-1]", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "filter odd function (variant 84)", | |
| "output": "def filter_odd(lst):\n return [x for x in lst if x % 2 != 0]", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "merge lists function (variant 85)", | |
| "output": "def merge_lists(l1, l2):\n return l1 + l2", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "merge lists function (variant 86)", | |
| "output": "def merge_lists(l1, l2):\n return l1 + l2", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "fibonacci function (variant 87)", | |
| "output": "def fib(n):\n if n <= 1: return n\n return fib(n-1) + fib(n-2)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "merge lists function (variant 88)", | |
| "output": "def merge_lists(l1, l2):\n return l1 + l2", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "remove duplicates function (variant 89)", | |
| "output": "def remove_dups(lst):\n return list(set(lst))", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "fibonacci function (variant 90)", | |
| "output": "def fib(n):\n if n <= 1: return n\n return fib(n-1) + fib(n-2)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "sum list function (variant 91)", | |
| "output": "def sum_list(lst):\n total = 0\n for num in lst:\n total += num\n return total", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "merge lists function (variant 92)", | |
| "output": "def merge_lists(l1, l2):\n return l1 + l2", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "merge lists function (variant 93)", | |
| "output": "def merge_lists(l1, l2):\n return l1 + l2", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "merge lists function (variant 94)", | |
| "output": "def merge_lists(l1, l2):\n return l1 + l2", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "remove duplicates function (variant 95)", | |
| "output": "def remove_dups(lst):\n return list(set(lst))", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "is prime function (variant 96)", | |
| "output": "def is_prime(n):\n if n < 2: return False\n for i in range(2, n):\n if n % i == 0: return False\n return True", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "count chars function (variant 97)", | |
| "output": "def count_chars(s):\n return len(s)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "sum list function (variant 98)", | |
| "output": "def sum_list(lst):\n total = 0\n for num in lst:\n total += num\n return total", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "filter odd function (variant 99)", | |
| "output": "def filter_odd(lst):\n return [x for x in lst if x % 2 != 0]", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "merge lists function (variant 100)", | |
| "output": "def merge_lists(l1, l2):\n return l1 + l2", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "count chars function (variant 101)", | |
| "output": "def count_chars(s):\n return len(s)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "reverse string function (variant 102)", | |
| "output": "def reverse(s):\n return s[::-1]", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "count chars function (variant 103)", | |
| "output": "def count_chars(s):\n return len(s)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "remove duplicates function (variant 104)", | |
| "output": "def remove_dups(lst):\n return list(set(lst))", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "factorial function (variant 105)", | |
| "output": "def factorial(n):\n return 1 if n <= 1 else n * factorial(n-1)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "sum list function (variant 106)", | |
| "output": "def sum_list(lst):\n total = 0\n for num in lst:\n total += num\n return total", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "remove duplicates function (variant 107)", | |
| "output": "def remove_dups(lst):\n return list(set(lst))", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "factorial function (variant 108)", | |
| "output": "def factorial(n):\n return 1 if n <= 1 else n * factorial(n-1)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "sum list function (variant 109)", | |
| "output": "def sum_list(lst):\n total = 0\n for num in lst:\n total += num\n return total", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "count chars function (variant 110)", | |
| "output": "def count_chars(s):\n return len(s)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "factorial function (variant 111)", | |
| "output": "def factorial(n):\n return 1 if n <= 1 else n * factorial(n-1)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "count chars function (variant 112)", | |
| "output": "def count_chars(s):\n return len(s)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "reverse string function (variant 113)", | |
| "output": "def reverse(s):\n return s[::-1]", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "find min max function (variant 114)", | |
| "output": "def find_range(lst):\n return (min(lst), max(lst))", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "fibonacci function (variant 115)", | |
| "output": "def fib(n):\n if n <= 1: return n\n return fib(n-1) + fib(n-2)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "find min max function (variant 116)", | |
| "output": "def find_range(lst):\n return (min(lst), max(lst))", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "filter odd function (variant 117)", | |
| "output": "def filter_odd(lst):\n return [x for x in lst if x % 2 != 0]", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "remove duplicates function (variant 118)", | |
| "output": "def remove_dups(lst):\n return list(set(lst))", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "fibonacci function (variant 119)", | |
| "output": "def fib(n):\n if n <= 1: return n\n return fib(n-1) + fib(n-2)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "merge lists function (variant 120)", | |
| "output": "def merge_lists(l1, l2):\n return l1 + l2", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "count chars function (variant 121)", | |
| "output": "def count_chars(s):\n return len(s)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "remove duplicates function (variant 122)", | |
| "output": "def remove_dups(lst):\n return list(set(lst))", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "filter odd function (variant 123)", | |
| "output": "def filter_odd(lst):\n return [x for x in lst if x % 2 != 0]", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "find min max function (variant 124)", | |
| "output": "def find_range(lst):\n return (min(lst), max(lst))", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "find min max function (variant 125)", | |
| "output": "def find_range(lst):\n return (min(lst), max(lst))", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "remove duplicates function (variant 126)", | |
| "output": "def remove_dups(lst):\n return list(set(lst))", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "sum list function (variant 127)", | |
| "output": "def sum_list(lst):\n total = 0\n for num in lst:\n total += num\n return total", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "remove duplicates function (variant 128)", | |
| "output": "def remove_dups(lst):\n return list(set(lst))", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "merge lists function (variant 129)", | |
| "output": "def merge_lists(l1, l2):\n return l1 + l2", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "is prime function (variant 130)", | |
| "output": "def is_prime(n):\n if n < 2: return False\n for i in range(2, n):\n if n % i == 0: return False\n return True", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "factorial function (variant 131)", | |
| "output": "def factorial(n):\n return 1 if n <= 1 else n * factorial(n-1)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "find min max function (variant 132)", | |
| "output": "def find_range(lst):\n return (min(lst), max(lst))", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "factorial function (variant 133)", | |
| "output": "def factorial(n):\n return 1 if n <= 1 else n * factorial(n-1)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "fibonacci function (variant 134)", | |
| "output": "def fib(n):\n if n <= 1: return n\n return fib(n-1) + fib(n-2)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "sum list function (variant 135)", | |
| "output": "def sum_list(lst):\n total = 0\n for num in lst:\n total += num\n return total", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "is prime function (variant 136)", | |
| "output": "def is_prime(n):\n if n < 2: return False\n for i in range(2, n):\n if n % i == 0: return False\n return True", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "merge lists function (variant 137)", | |
| "output": "def merge_lists(l1, l2):\n return l1 + l2", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "merge lists function (variant 138)", | |
| "output": "def merge_lists(l1, l2):\n return l1 + l2", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "fibonacci function (variant 139)", | |
| "output": "def fib(n):\n if n <= 1: return n\n return fib(n-1) + fib(n-2)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "filter odd function (variant 140)", | |
| "output": "def filter_odd(lst):\n return [x for x in lst if x % 2 != 0]", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "filter odd function (variant 141)", | |
| "output": "def filter_odd(lst):\n return [x for x in lst if x % 2 != 0]", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "merge lists function (variant 142)", | |
| "output": "def merge_lists(l1, l2):\n return l1 + l2", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "reverse string function (variant 143)", | |
| "output": "def reverse(s):\n return s[::-1]", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "remove duplicates function (variant 144)", | |
| "output": "def remove_dups(lst):\n return list(set(lst))", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "fibonacci function (variant 145)", | |
| "output": "def fib(n):\n if n <= 1: return n\n return fib(n-1) + fib(n-2)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "count chars function (variant 146)", | |
| "output": "def count_chars(s):\n return len(s)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "remove duplicates function (variant 147)", | |
| "output": "def remove_dups(lst):\n return list(set(lst))", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "fibonacci function (variant 148)", | |
| "output": "def fib(n):\n if n <= 1: return n\n return fib(n-1) + fib(n-2)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "factorial function (variant 149)", | |
| "output": "def factorial(n):\n return 1 if n <= 1 else n * factorial(n-1)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "merge lists function (variant 150)", | |
| "output": "def merge_lists(l1, l2):\n return l1 + l2", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "filter odd function (variant 151)", | |
| "output": "def filter_odd(lst):\n return [x for x in lst if x % 2 != 0]", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "remove duplicates function (variant 152)", | |
| "output": "def remove_dups(lst):\n return list(set(lst))", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "is prime function (variant 153)", | |
| "output": "def is_prime(n):\n if n < 2: return False\n for i in range(2, n):\n if n % i == 0: return False\n return True", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "sum list function (variant 154)", | |
| "output": "def sum_list(lst):\n total = 0\n for num in lst:\n total += num\n return total", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "fibonacci function (variant 155)", | |
| "output": "def fib(n):\n if n <= 1: return n\n return fib(n-1) + fib(n-2)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "filter odd function (variant 156)", | |
| "output": "def filter_odd(lst):\n return [x for x in lst if x % 2 != 0]", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "merge lists function (variant 157)", | |
| "output": "def merge_lists(l1, l2):\n return l1 + l2", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "factorial function (variant 158)", | |
| "output": "def factorial(n):\n return 1 if n <= 1 else n * factorial(n-1)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "count chars function (variant 159)", | |
| "output": "def count_chars(s):\n return len(s)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "count chars function (variant 160)", | |
| "output": "def count_chars(s):\n return len(s)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "reverse string function (variant 161)", | |
| "output": "def reverse(s):\n return s[::-1]", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "is prime function (variant 162)", | |
| "output": "def is_prime(n):\n if n < 2: return False\n for i in range(2, n):\n if n % i == 0: return False\n return True", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "fibonacci function (variant 163)", | |
| "output": "def fib(n):\n if n <= 1: return n\n return fib(n-1) + fib(n-2)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "remove duplicates function (variant 164)", | |
| "output": "def remove_dups(lst):\n return list(set(lst))", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "count chars function (variant 165)", | |
| "output": "def count_chars(s):\n return len(s)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "sum list function (variant 166)", | |
| "output": "def sum_list(lst):\n total = 0\n for num in lst:\n total += num\n return total", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "merge lists function (variant 167)", | |
| "output": "def merge_lists(l1, l2):\n return l1 + l2", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "reverse string function (variant 168)", | |
| "output": "def reverse(s):\n return s[::-1]", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "find min max function (variant 169)", | |
| "output": "def find_range(lst):\n return (min(lst), max(lst))", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "filter odd function (variant 170)", | |
| "output": "def filter_odd(lst):\n return [x for x in lst if x % 2 != 0]", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "find min max function (variant 171)", | |
| "output": "def find_range(lst):\n return (min(lst), max(lst))", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "reverse string function (variant 172)", | |
| "output": "def reverse(s):\n return s[::-1]", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "filter odd function (variant 173)", | |
| "output": "def filter_odd(lst):\n return [x for x in lst if x % 2 != 0]", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "sum list function (variant 174)", | |
| "output": "def sum_list(lst):\n total = 0\n for num in lst:\n total += num\n return total", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "reverse string function (variant 175)", | |
| "output": "def reverse(s):\n return s[::-1]", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "filter odd function (variant 176)", | |
| "output": "def filter_odd(lst):\n return [x for x in lst if x % 2 != 0]", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "filter odd function (variant 177)", | |
| "output": "def filter_odd(lst):\n return [x for x in lst if x % 2 != 0]", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "is prime function (variant 178)", | |
| "output": "def is_prime(n):\n if n < 2: return False\n for i in range(2, n):\n if n % i == 0: return False\n return True", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "remove duplicates function (variant 179)", | |
| "output": "def remove_dups(lst):\n return list(set(lst))", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "remove duplicates function (variant 180)", | |
| "output": "def remove_dups(lst):\n return list(set(lst))", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "is prime function (variant 181)", | |
| "output": "def is_prime(n):\n if n < 2: return False\n for i in range(2, n):\n if n % i == 0: return False\n return True", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "fibonacci function (variant 182)", | |
| "output": "def fib(n):\n if n <= 1: return n\n return fib(n-1) + fib(n-2)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "fibonacci function (variant 183)", | |
| "output": "def fib(n):\n if n <= 1: return n\n return fib(n-1) + fib(n-2)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "count chars function (variant 184)", | |
| "output": "def count_chars(s):\n return len(s)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "remove duplicates function (variant 185)", | |
| "output": "def remove_dups(lst):\n return list(set(lst))", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "is prime function (variant 186)", | |
| "output": "def is_prime(n):\n if n < 2: return False\n for i in range(2, n):\n if n % i == 0: return False\n return True", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "remove duplicates function (variant 187)", | |
| "output": "def remove_dups(lst):\n return list(set(lst))", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "remove duplicates function (variant 188)", | |
| "output": "def remove_dups(lst):\n return list(set(lst))", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "reverse string function (variant 189)", | |
| "output": "def reverse(s):\n return s[::-1]", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "fibonacci function (variant 190)", | |
| "output": "def fib(n):\n if n <= 1: return n\n return fib(n-1) + fib(n-2)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "merge lists function (variant 191)", | |
| "output": "def merge_lists(l1, l2):\n return l1 + l2", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "reverse string function (variant 192)", | |
| "output": "def reverse(s):\n return s[::-1]", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "find min max function (variant 193)", | |
| "output": "def find_range(lst):\n return (min(lst), max(lst))", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "factorial function (variant 194)", | |
| "output": "def factorial(n):\n return 1 if n <= 1 else n * factorial(n-1)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "merge lists function (variant 195)", | |
| "output": "def merge_lists(l1, l2):\n return l1 + l2", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "sum list function (variant 196)", | |
| "output": "def sum_list(lst):\n total = 0\n for num in lst:\n total += num\n return total", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "count chars function (variant 197)", | |
| "output": "def count_chars(s):\n return len(s)", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "merge lists function (variant 198)", | |
| "output": "def merge_lists(l1, l2):\n return l1 + l2", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "filter odd function (variant 199)", | |
| "output": "def filter_odd(lst):\n return [x for x in lst if x % 2 != 0]", | |
| "tags": [ | |
| "functions", | |
| "intermediate" | |
| ] | |
| }, | |
| { | |
| "input": "method example 0", | |
| "output": "class Dog:\n def bark(self):\n return 'Woof!'", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "inheritance example 1", | |
| "output": "class Vehicle:\n pass\n\nclass Car(Vehicle):\n pass", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "property example 2", | |
| "output": "class Circle:\n def __init__(self, r):\n self.radius = r\n def area(self):\n return 3.14 * self.radius**2", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "property example 3", | |
| "output": "class Circle:\n def __init__(self, r):\n self.radius = r\n def area(self):\n return 3.14 * self.radius**2", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "method example 4", | |
| "output": "class Dog:\n def bark(self):\n return 'Woof!'", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "inheritance example 5", | |
| "output": "class Vehicle:\n pass\n\nclass Car(Vehicle):\n pass", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "method example 6", | |
| "output": "class Dog:\n def bark(self):\n return 'Woof!'", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "simple class example 7", | |
| "output": "class Car:\n def __init__(self, brand):\n self.brand = brand", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "simple class example 8", | |
| "output": "class Car:\n def __init__(self, brand):\n self.brand = brand", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "property example 9", | |
| "output": "class Circle:\n def __init__(self, r):\n self.radius = r\n def area(self):\n return 3.14 * self.radius**2", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "inheritance example 10", | |
| "output": "class Vehicle:\n pass\n\nclass Car(Vehicle):\n pass", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "inheritance example 11", | |
| "output": "class Vehicle:\n pass\n\nclass Car(Vehicle):\n pass", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "property example 12", | |
| "output": "class Circle:\n def __init__(self, r):\n self.radius = r\n def area(self):\n return 3.14 * self.radius**2", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "inheritance example 13", | |
| "output": "class Vehicle:\n pass\n\nclass Car(Vehicle):\n pass", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "property example 14", | |
| "output": "class Circle:\n def __init__(self, r):\n self.radius = r\n def area(self):\n return 3.14 * self.radius**2", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "method example 15", | |
| "output": "class Dog:\n def bark(self):\n return 'Woof!'", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "simple class example 16", | |
| "output": "class Car:\n def __init__(self, brand):\n self.brand = brand", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "property example 17", | |
| "output": "class Circle:\n def __init__(self, r):\n self.radius = r\n def area(self):\n return 3.14 * self.radius**2", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "method example 18", | |
| "output": "class Dog:\n def bark(self):\n return 'Woof!'", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "property example 19", | |
| "output": "class Circle:\n def __init__(self, r):\n self.radius = r\n def area(self):\n return 3.14 * self.radius**2", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "property example 20", | |
| "output": "class Circle:\n def __init__(self, r):\n self.radius = r\n def area(self):\n return 3.14 * self.radius**2", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "method example 21", | |
| "output": "class Dog:\n def bark(self):\n return 'Woof!'", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "inheritance example 22", | |
| "output": "class Vehicle:\n pass\n\nclass Car(Vehicle):\n pass", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "simple class example 23", | |
| "output": "class Car:\n def __init__(self, brand):\n self.brand = brand", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "property example 24", | |
| "output": "class Circle:\n def __init__(self, r):\n self.radius = r\n def area(self):\n return 3.14 * self.radius**2", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "method example 25", | |
| "output": "class Dog:\n def bark(self):\n return 'Woof!'", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "method example 26", | |
| "output": "class Dog:\n def bark(self):\n return 'Woof!'", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "inheritance example 27", | |
| "output": "class Vehicle:\n pass\n\nclass Car(Vehicle):\n pass", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "inheritance example 28", | |
| "output": "class Vehicle:\n pass\n\nclass Car(Vehicle):\n pass", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "method example 29", | |
| "output": "class Dog:\n def bark(self):\n return 'Woof!'", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "method example 30", | |
| "output": "class Dog:\n def bark(self):\n return 'Woof!'", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "simple class example 31", | |
| "output": "class Car:\n def __init__(self, brand):\n self.brand = brand", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "property example 32", | |
| "output": "class Circle:\n def __init__(self, r):\n self.radius = r\n def area(self):\n return 3.14 * self.radius**2", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "inheritance example 33", | |
| "output": "class Vehicle:\n pass\n\nclass Car(Vehicle):\n pass", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "simple class example 34", | |
| "output": "class Car:\n def __init__(self, brand):\n self.brand = brand", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "property example 35", | |
| "output": "class Circle:\n def __init__(self, r):\n self.radius = r\n def area(self):\n return 3.14 * self.radius**2", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "property example 36", | |
| "output": "class Circle:\n def __init__(self, r):\n self.radius = r\n def area(self):\n return 3.14 * self.radius**2", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "inheritance example 37", | |
| "output": "class Vehicle:\n pass\n\nclass Car(Vehicle):\n pass", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "simple class example 38", | |
| "output": "class Car:\n def __init__(self, brand):\n self.brand = brand", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "property example 39", | |
| "output": "class Circle:\n def __init__(self, r):\n self.radius = r\n def area(self):\n return 3.14 * self.radius**2", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "property example 40", | |
| "output": "class Circle:\n def __init__(self, r):\n self.radius = r\n def area(self):\n return 3.14 * self.radius**2", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "method example 41", | |
| "output": "class Dog:\n def bark(self):\n return 'Woof!'", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "property example 42", | |
| "output": "class Circle:\n def __init__(self, r):\n self.radius = r\n def area(self):\n return 3.14 * self.radius**2", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "method example 43", | |
| "output": "class Dog:\n def bark(self):\n return 'Woof!'", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "method example 44", | |
| "output": "class Dog:\n def bark(self):\n return 'Woof!'", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "inheritance example 45", | |
| "output": "class Vehicle:\n pass\n\nclass Car(Vehicle):\n pass", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "inheritance example 46", | |
| "output": "class Vehicle:\n pass\n\nclass Car(Vehicle):\n pass", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "inheritance example 47", | |
| "output": "class Vehicle:\n pass\n\nclass Car(Vehicle):\n pass", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "property example 48", | |
| "output": "class Circle:\n def __init__(self, r):\n self.radius = r\n def area(self):\n return 3.14 * self.radius**2", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "inheritance example 49", | |
| "output": "class Vehicle:\n pass\n\nclass Car(Vehicle):\n pass", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "property example 50", | |
| "output": "class Circle:\n def __init__(self, r):\n self.radius = r\n def area(self):\n return 3.14 * self.radius**2", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "property example 51", | |
| "output": "class Circle:\n def __init__(self, r):\n self.radius = r\n def area(self):\n return 3.14 * self.radius**2", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "inheritance example 52", | |
| "output": "class Vehicle:\n pass\n\nclass Car(Vehicle):\n pass", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "inheritance example 53", | |
| "output": "class Vehicle:\n pass\n\nclass Car(Vehicle):\n pass", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "inheritance example 54", | |
| "output": "class Vehicle:\n pass\n\nclass Car(Vehicle):\n pass", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "simple class example 55", | |
| "output": "class Car:\n def __init__(self, brand):\n self.brand = brand", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "inheritance example 56", | |
| "output": "class Vehicle:\n pass\n\nclass Car(Vehicle):\n pass", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "inheritance example 57", | |
| "output": "class Vehicle:\n pass\n\nclass Car(Vehicle):\n pass", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "simple class example 58", | |
| "output": "class Car:\n def __init__(self, brand):\n self.brand = brand", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "property example 59", | |
| "output": "class Circle:\n def __init__(self, r):\n self.radius = r\n def area(self):\n return 3.14 * self.radius**2", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "method example 60", | |
| "output": "class Dog:\n def bark(self):\n return 'Woof!'", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "inheritance example 61", | |
| "output": "class Vehicle:\n pass\n\nclass Car(Vehicle):\n pass", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "method example 62", | |
| "output": "class Dog:\n def bark(self):\n return 'Woof!'", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "inheritance example 63", | |
| "output": "class Vehicle:\n pass\n\nclass Car(Vehicle):\n pass", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "inheritance example 64", | |
| "output": "class Vehicle:\n pass\n\nclass Car(Vehicle):\n pass", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "inheritance example 65", | |
| "output": "class Vehicle:\n pass\n\nclass Car(Vehicle):\n pass", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "property example 66", | |
| "output": "class Circle:\n def __init__(self, r):\n self.radius = r\n def area(self):\n return 3.14 * self.radius**2", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "property example 67", | |
| "output": "class Circle:\n def __init__(self, r):\n self.radius = r\n def area(self):\n return 3.14 * self.radius**2", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "method example 68", | |
| "output": "class Dog:\n def bark(self):\n return 'Woof!'", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "method example 69", | |
| "output": "class Dog:\n def bark(self):\n return 'Woof!'", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "method example 70", | |
| "output": "class Dog:\n def bark(self):\n return 'Woof!'", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "property example 71", | |
| "output": "class Circle:\n def __init__(self, r):\n self.radius = r\n def area(self):\n return 3.14 * self.radius**2", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "property example 72", | |
| "output": "class Circle:\n def __init__(self, r):\n self.radius = r\n def area(self):\n return 3.14 * self.radius**2", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "simple class example 73", | |
| "output": "class Car:\n def __init__(self, brand):\n self.brand = brand", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "inheritance example 74", | |
| "output": "class Vehicle:\n pass\n\nclass Car(Vehicle):\n pass", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "property example 75", | |
| "output": "class Circle:\n def __init__(self, r):\n self.radius = r\n def area(self):\n return 3.14 * self.radius**2", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "property example 76", | |
| "output": "class Circle:\n def __init__(self, r):\n self.radius = r\n def area(self):\n return 3.14 * self.radius**2", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "simple class example 77", | |
| "output": "class Car:\n def __init__(self, brand):\n self.brand = brand", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "method example 78", | |
| "output": "class Dog:\n def bark(self):\n return 'Woof!'", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "property example 79", | |
| "output": "class Circle:\n def __init__(self, r):\n self.radius = r\n def area(self):\n return 3.14 * self.radius**2", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "property example 80", | |
| "output": "class Circle:\n def __init__(self, r):\n self.radius = r\n def area(self):\n return 3.14 * self.radius**2", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "method example 81", | |
| "output": "class Dog:\n def bark(self):\n return 'Woof!'", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "inheritance example 82", | |
| "output": "class Vehicle:\n pass\n\nclass Car(Vehicle):\n pass", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "property example 83", | |
| "output": "class Circle:\n def __init__(self, r):\n self.radius = r\n def area(self):\n return 3.14 * self.radius**2", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "simple class example 84", | |
| "output": "class Car:\n def __init__(self, brand):\n self.brand = brand", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "inheritance example 85", | |
| "output": "class Vehicle:\n pass\n\nclass Car(Vehicle):\n pass", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "property example 86", | |
| "output": "class Circle:\n def __init__(self, r):\n self.radius = r\n def area(self):\n return 3.14 * self.radius**2", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "inheritance example 87", | |
| "output": "class Vehicle:\n pass\n\nclass Car(Vehicle):\n pass", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "inheritance example 88", | |
| "output": "class Vehicle:\n pass\n\nclass Car(Vehicle):\n pass", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "method example 89", | |
| "output": "class Dog:\n def bark(self):\n return 'Woof!'", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "property example 90", | |
| "output": "class Circle:\n def __init__(self, r):\n self.radius = r\n def area(self):\n return 3.14 * self.radius**2", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "inheritance example 91", | |
| "output": "class Vehicle:\n pass\n\nclass Car(Vehicle):\n pass", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "property example 92", | |
| "output": "class Circle:\n def __init__(self, r):\n self.radius = r\n def area(self):\n return 3.14 * self.radius**2", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "property example 93", | |
| "output": "class Circle:\n def __init__(self, r):\n self.radius = r\n def area(self):\n return 3.14 * self.radius**2", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "simple class example 94", | |
| "output": "class Car:\n def __init__(self, brand):\n self.brand = brand", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "inheritance example 95", | |
| "output": "class Vehicle:\n pass\n\nclass Car(Vehicle):\n pass", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "method example 96", | |
| "output": "class Dog:\n def bark(self):\n return 'Woof!'", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "property example 97", | |
| "output": "class Circle:\n def __init__(self, r):\n self.radius = r\n def area(self):\n return 3.14 * self.radius**2", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "inheritance example 98", | |
| "output": "class Vehicle:\n pass\n\nclass Car(Vehicle):\n pass", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "method example 99", | |
| "output": "class Dog:\n def bark(self):\n return 'Woof!'", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "method example 100", | |
| "output": "class Dog:\n def bark(self):\n return 'Woof!'", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "property example 101", | |
| "output": "class Circle:\n def __init__(self, r):\n self.radius = r\n def area(self):\n return 3.14 * self.radius**2", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "method example 102", | |
| "output": "class Dog:\n def bark(self):\n return 'Woof!'", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "property example 103", | |
| "output": "class Circle:\n def __init__(self, r):\n self.radius = r\n def area(self):\n return 3.14 * self.radius**2", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "property example 104", | |
| "output": "class Circle:\n def __init__(self, r):\n self.radius = r\n def area(self):\n return 3.14 * self.radius**2", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "property example 105", | |
| "output": "class Circle:\n def __init__(self, r):\n self.radius = r\n def area(self):\n return 3.14 * self.radius**2", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "property example 106", | |
| "output": "class Circle:\n def __init__(self, r):\n self.radius = r\n def area(self):\n return 3.14 * self.radius**2", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "inheritance example 107", | |
| "output": "class Vehicle:\n pass\n\nclass Car(Vehicle):\n pass", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "simple class example 108", | |
| "output": "class Car:\n def __init__(self, brand):\n self.brand = brand", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "simple class example 109", | |
| "output": "class Car:\n def __init__(self, brand):\n self.brand = brand", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "simple class example 110", | |
| "output": "class Car:\n def __init__(self, brand):\n self.brand = brand", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "method example 111", | |
| "output": "class Dog:\n def bark(self):\n return 'Woof!'", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "inheritance example 112", | |
| "output": "class Vehicle:\n pass\n\nclass Car(Vehicle):\n pass", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "property example 113", | |
| "output": "class Circle:\n def __init__(self, r):\n self.radius = r\n def area(self):\n return 3.14 * self.radius**2", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "simple class example 114", | |
| "output": "class Car:\n def __init__(self, brand):\n self.brand = brand", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "inheritance example 115", | |
| "output": "class Vehicle:\n pass\n\nclass Car(Vehicle):\n pass", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "inheritance example 116", | |
| "output": "class Vehicle:\n pass\n\nclass Car(Vehicle):\n pass", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "inheritance example 117", | |
| "output": "class Vehicle:\n pass\n\nclass Car(Vehicle):\n pass", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "method example 118", | |
| "output": "class Dog:\n def bark(self):\n return 'Woof!'", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "simple class example 119", | |
| "output": "class Car:\n def __init__(self, brand):\n self.brand = brand", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "property example 120", | |
| "output": "class Circle:\n def __init__(self, r):\n self.radius = r\n def area(self):\n return 3.14 * self.radius**2", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "method example 121", | |
| "output": "class Dog:\n def bark(self):\n return 'Woof!'", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "method example 122", | |
| "output": "class Dog:\n def bark(self):\n return 'Woof!'", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "property example 123", | |
| "output": "class Circle:\n def __init__(self, r):\n self.radius = r\n def area(self):\n return 3.14 * self.radius**2", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "inheritance example 124", | |
| "output": "class Vehicle:\n pass\n\nclass Car(Vehicle):\n pass", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "inheritance example 125", | |
| "output": "class Vehicle:\n pass\n\nclass Car(Vehicle):\n pass", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "property example 126", | |
| "output": "class Circle:\n def __init__(self, r):\n self.radius = r\n def area(self):\n return 3.14 * self.radius**2", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "inheritance example 127", | |
| "output": "class Vehicle:\n pass\n\nclass Car(Vehicle):\n pass", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "method example 128", | |
| "output": "class Dog:\n def bark(self):\n return 'Woof!'", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "inheritance example 129", | |
| "output": "class Vehicle:\n pass\n\nclass Car(Vehicle):\n pass", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "inheritance example 130", | |
| "output": "class Vehicle:\n pass\n\nclass Car(Vehicle):\n pass", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "inheritance example 131", | |
| "output": "class Vehicle:\n pass\n\nclass Car(Vehicle):\n pass", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "method example 132", | |
| "output": "class Dog:\n def bark(self):\n return 'Woof!'", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "inheritance example 133", | |
| "output": "class Vehicle:\n pass\n\nclass Car(Vehicle):\n pass", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "inheritance example 134", | |
| "output": "class Vehicle:\n pass\n\nclass Car(Vehicle):\n pass", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "property example 135", | |
| "output": "class Circle:\n def __init__(self, r):\n self.radius = r\n def area(self):\n return 3.14 * self.radius**2", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "inheritance example 136", | |
| "output": "class Vehicle:\n pass\n\nclass Car(Vehicle):\n pass", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "inheritance example 137", | |
| "output": "class Vehicle:\n pass\n\nclass Car(Vehicle):\n pass", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "method example 138", | |
| "output": "class Dog:\n def bark(self):\n return 'Woof!'", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "inheritance example 139", | |
| "output": "class Vehicle:\n pass\n\nclass Car(Vehicle):\n pass", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "property example 140", | |
| "output": "class Circle:\n def __init__(self, r):\n self.radius = r\n def area(self):\n return 3.14 * self.radius**2", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "simple class example 141", | |
| "output": "class Car:\n def __init__(self, brand):\n self.brand = brand", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "inheritance example 142", | |
| "output": "class Vehicle:\n pass\n\nclass Car(Vehicle):\n pass", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "property example 143", | |
| "output": "class Circle:\n def __init__(self, r):\n self.radius = r\n def area(self):\n return 3.14 * self.radius**2", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "inheritance example 144", | |
| "output": "class Vehicle:\n pass\n\nclass Car(Vehicle):\n pass", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "method example 145", | |
| "output": "class Dog:\n def bark(self):\n return 'Woof!'", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "method example 146", | |
| "output": "class Dog:\n def bark(self):\n return 'Woof!'", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "simple class example 147", | |
| "output": "class Car:\n def __init__(self, brand):\n self.brand = brand", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "method example 148", | |
| "output": "class Dog:\n def bark(self):\n return 'Woof!'", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "property example 149", | |
| "output": "class Circle:\n def __init__(self, r):\n self.radius = r\n def area(self):\n return 3.14 * self.radius**2", | |
| "tags": [ | |
| "oop", | |
| "classes", | |
| "advanced" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 0", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "try except pattern 1", | |
| "output": "try:\n x = 1/0\nexcept ZeroDivisionError:\n print('Cannot divide by zero')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 2", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 3", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "try except pattern 4", | |
| "output": "try:\n x = 1/0\nexcept ZeroDivisionError:\n print('Cannot divide by zero')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "try except pattern 5", | |
| "output": "try:\n x = 1/0\nexcept ZeroDivisionError:\n print('Cannot divide by zero')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "try except pattern 6", | |
| "output": "try:\n x = 1/0\nexcept ZeroDivisionError:\n print('Cannot divide by zero')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "try except pattern 7", | |
| "output": "try:\n x = 1/0\nexcept ZeroDivisionError:\n print('Cannot divide by zero')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 8", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 9", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 10", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "try except pattern 11", | |
| "output": "try:\n x = 1/0\nexcept ZeroDivisionError:\n print('Cannot divide by zero')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "try except pattern 12", | |
| "output": "try:\n x = 1/0\nexcept ZeroDivisionError:\n print('Cannot divide by zero')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 13", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "try except pattern 14", | |
| "output": "try:\n x = 1/0\nexcept ZeroDivisionError:\n print('Cannot divide by zero')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "multiple except pattern 15", | |
| "output": "try:\n result = int('abc')\nexcept ValueError:\n print('Invalid value')\nexcept TypeError:\n print('Type error')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "multiple except pattern 16", | |
| "output": "try:\n result = int('abc')\nexcept ValueError:\n print('Invalid value')\nexcept TypeError:\n print('Type error')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "try except pattern 17", | |
| "output": "try:\n x = 1/0\nexcept ZeroDivisionError:\n print('Cannot divide by zero')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "try except pattern 18", | |
| "output": "try:\n x = 1/0\nexcept ZeroDivisionError:\n print('Cannot divide by zero')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "multiple except pattern 19", | |
| "output": "try:\n result = int('abc')\nexcept ValueError:\n print('Invalid value')\nexcept TypeError:\n print('Type error')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "try except pattern 20", | |
| "output": "try:\n x = 1/0\nexcept ZeroDivisionError:\n print('Cannot divide by zero')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "try except pattern 21", | |
| "output": "try:\n x = 1/0\nexcept ZeroDivisionError:\n print('Cannot divide by zero')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "multiple except pattern 22", | |
| "output": "try:\n result = int('abc')\nexcept ValueError:\n print('Invalid value')\nexcept TypeError:\n print('Type error')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "try except pattern 23", | |
| "output": "try:\n x = 1/0\nexcept ZeroDivisionError:\n print('Cannot divide by zero')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "multiple except pattern 24", | |
| "output": "try:\n result = int('abc')\nexcept ValueError:\n print('Invalid value')\nexcept TypeError:\n print('Type error')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "multiple except pattern 25", | |
| "output": "try:\n result = int('abc')\nexcept ValueError:\n print('Invalid value')\nexcept TypeError:\n print('Type error')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "try except pattern 26", | |
| "output": "try:\n x = 1/0\nexcept ZeroDivisionError:\n print('Cannot divide by zero')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 27", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "multiple except pattern 28", | |
| "output": "try:\n result = int('abc')\nexcept ValueError:\n print('Invalid value')\nexcept TypeError:\n print('Type error')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 29", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "try except pattern 30", | |
| "output": "try:\n x = 1/0\nexcept ZeroDivisionError:\n print('Cannot divide by zero')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 31", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 32", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 33", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "try except pattern 34", | |
| "output": "try:\n x = 1/0\nexcept ZeroDivisionError:\n print('Cannot divide by zero')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "multiple except pattern 35", | |
| "output": "try:\n result = int('abc')\nexcept ValueError:\n print('Invalid value')\nexcept TypeError:\n print('Type error')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 36", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 37", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "multiple except pattern 38", | |
| "output": "try:\n result = int('abc')\nexcept ValueError:\n print('Invalid value')\nexcept TypeError:\n print('Type error')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 39", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 40", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "multiple except pattern 41", | |
| "output": "try:\n result = int('abc')\nexcept ValueError:\n print('Invalid value')\nexcept TypeError:\n print('Type error')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "try except pattern 42", | |
| "output": "try:\n x = 1/0\nexcept ZeroDivisionError:\n print('Cannot divide by zero')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "try except pattern 43", | |
| "output": "try:\n x = 1/0\nexcept ZeroDivisionError:\n print('Cannot divide by zero')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 44", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "multiple except pattern 45", | |
| "output": "try:\n result = int('abc')\nexcept ValueError:\n print('Invalid value')\nexcept TypeError:\n print('Type error')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "try except pattern 46", | |
| "output": "try:\n x = 1/0\nexcept ZeroDivisionError:\n print('Cannot divide by zero')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 47", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "try except pattern 48", | |
| "output": "try:\n x = 1/0\nexcept ZeroDivisionError:\n print('Cannot divide by zero')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "try except pattern 49", | |
| "output": "try:\n x = 1/0\nexcept ZeroDivisionError:\n print('Cannot divide by zero')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "multiple except pattern 50", | |
| "output": "try:\n result = int('abc')\nexcept ValueError:\n print('Invalid value')\nexcept TypeError:\n print('Type error')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "multiple except pattern 51", | |
| "output": "try:\n result = int('abc')\nexcept ValueError:\n print('Invalid value')\nexcept TypeError:\n print('Type error')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 52", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "try except pattern 53", | |
| "output": "try:\n x = 1/0\nexcept ZeroDivisionError:\n print('Cannot divide by zero')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 54", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "multiple except pattern 55", | |
| "output": "try:\n result = int('abc')\nexcept ValueError:\n print('Invalid value')\nexcept TypeError:\n print('Type error')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "try except pattern 56", | |
| "output": "try:\n x = 1/0\nexcept ZeroDivisionError:\n print('Cannot divide by zero')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 57", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "try except pattern 58", | |
| "output": "try:\n x = 1/0\nexcept ZeroDivisionError:\n print('Cannot divide by zero')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 59", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "multiple except pattern 60", | |
| "output": "try:\n result = int('abc')\nexcept ValueError:\n print('Invalid value')\nexcept TypeError:\n print('Type error')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 61", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "try except pattern 62", | |
| "output": "try:\n x = 1/0\nexcept ZeroDivisionError:\n print('Cannot divide by zero')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "try except pattern 63", | |
| "output": "try:\n x = 1/0\nexcept ZeroDivisionError:\n print('Cannot divide by zero')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "try except pattern 64", | |
| "output": "try:\n x = 1/0\nexcept ZeroDivisionError:\n print('Cannot divide by zero')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "try except pattern 65", | |
| "output": "try:\n x = 1/0\nexcept ZeroDivisionError:\n print('Cannot divide by zero')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 66", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "try except pattern 67", | |
| "output": "try:\n x = 1/0\nexcept ZeroDivisionError:\n print('Cannot divide by zero')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 68", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "try except pattern 69", | |
| "output": "try:\n x = 1/0\nexcept ZeroDivisionError:\n print('Cannot divide by zero')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 70", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 71", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 72", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 73", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "multiple except pattern 74", | |
| "output": "try:\n result = int('abc')\nexcept ValueError:\n print('Invalid value')\nexcept TypeError:\n print('Type error')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "try except pattern 75", | |
| "output": "try:\n x = 1/0\nexcept ZeroDivisionError:\n print('Cannot divide by zero')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "multiple except pattern 76", | |
| "output": "try:\n result = int('abc')\nexcept ValueError:\n print('Invalid value')\nexcept TypeError:\n print('Type error')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "multiple except pattern 77", | |
| "output": "try:\n result = int('abc')\nexcept ValueError:\n print('Invalid value')\nexcept TypeError:\n print('Type error')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "multiple except pattern 78", | |
| "output": "try:\n result = int('abc')\nexcept ValueError:\n print('Invalid value')\nexcept TypeError:\n print('Type error')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 79", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 80", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "try except pattern 81", | |
| "output": "try:\n x = 1/0\nexcept ZeroDivisionError:\n print('Cannot divide by zero')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 82", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "try except pattern 83", | |
| "output": "try:\n x = 1/0\nexcept ZeroDivisionError:\n print('Cannot divide by zero')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 84", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "multiple except pattern 85", | |
| "output": "try:\n result = int('abc')\nexcept ValueError:\n print('Invalid value')\nexcept TypeError:\n print('Type error')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "try except pattern 86", | |
| "output": "try:\n x = 1/0\nexcept ZeroDivisionError:\n print('Cannot divide by zero')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "multiple except pattern 87", | |
| "output": "try:\n result = int('abc')\nexcept ValueError:\n print('Invalid value')\nexcept TypeError:\n print('Type error')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "try except pattern 88", | |
| "output": "try:\n x = 1/0\nexcept ZeroDivisionError:\n print('Cannot divide by zero')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 89", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "multiple except pattern 90", | |
| "output": "try:\n result = int('abc')\nexcept ValueError:\n print('Invalid value')\nexcept TypeError:\n print('Type error')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "multiple except pattern 91", | |
| "output": "try:\n result = int('abc')\nexcept ValueError:\n print('Invalid value')\nexcept TypeError:\n print('Type error')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "try except pattern 92", | |
| "output": "try:\n x = 1/0\nexcept ZeroDivisionError:\n print('Cannot divide by zero')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 93", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 94", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "multiple except pattern 95", | |
| "output": "try:\n result = int('abc')\nexcept ValueError:\n print('Invalid value')\nexcept TypeError:\n print('Type error')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 96", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "try except pattern 97", | |
| "output": "try:\n x = 1/0\nexcept ZeroDivisionError:\n print('Cannot divide by zero')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "multiple except pattern 98", | |
| "output": "try:\n result = int('abc')\nexcept ValueError:\n print('Invalid value')\nexcept TypeError:\n print('Type error')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 99", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "try except pattern 100", | |
| "output": "try:\n x = 1/0\nexcept ZeroDivisionError:\n print('Cannot divide by zero')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "multiple except pattern 101", | |
| "output": "try:\n result = int('abc')\nexcept ValueError:\n print('Invalid value')\nexcept TypeError:\n print('Type error')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "multiple except pattern 102", | |
| "output": "try:\n result = int('abc')\nexcept ValueError:\n print('Invalid value')\nexcept TypeError:\n print('Type error')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "try except pattern 103", | |
| "output": "try:\n x = 1/0\nexcept ZeroDivisionError:\n print('Cannot divide by zero')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "multiple except pattern 104", | |
| "output": "try:\n result = int('abc')\nexcept ValueError:\n print('Invalid value')\nexcept TypeError:\n print('Type error')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "try except pattern 105", | |
| "output": "try:\n x = 1/0\nexcept ZeroDivisionError:\n print('Cannot divide by zero')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 106", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "try except pattern 107", | |
| "output": "try:\n x = 1/0\nexcept ZeroDivisionError:\n print('Cannot divide by zero')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "try except pattern 108", | |
| "output": "try:\n x = 1/0\nexcept ZeroDivisionError:\n print('Cannot divide by zero')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "try except pattern 109", | |
| "output": "try:\n x = 1/0\nexcept ZeroDivisionError:\n print('Cannot divide by zero')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "multiple except pattern 110", | |
| "output": "try:\n result = int('abc')\nexcept ValueError:\n print('Invalid value')\nexcept TypeError:\n print('Type error')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "multiple except pattern 111", | |
| "output": "try:\n result = int('abc')\nexcept ValueError:\n print('Invalid value')\nexcept TypeError:\n print('Type error')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "multiple except pattern 112", | |
| "output": "try:\n result = int('abc')\nexcept ValueError:\n print('Invalid value')\nexcept TypeError:\n print('Type error')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 113", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 114", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 115", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 116", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 117", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "try except pattern 118", | |
| "output": "try:\n x = 1/0\nexcept ZeroDivisionError:\n print('Cannot divide by zero')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "multiple except pattern 119", | |
| "output": "try:\n result = int('abc')\nexcept ValueError:\n print('Invalid value')\nexcept TypeError:\n print('Type error')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 120", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "multiple except pattern 121", | |
| "output": "try:\n result = int('abc')\nexcept ValueError:\n print('Invalid value')\nexcept TypeError:\n print('Type error')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 122", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "multiple except pattern 123", | |
| "output": "try:\n result = int('abc')\nexcept ValueError:\n print('Invalid value')\nexcept TypeError:\n print('Type error')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 124", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "multiple except pattern 125", | |
| "output": "try:\n result = int('abc')\nexcept ValueError:\n print('Invalid value')\nexcept TypeError:\n print('Type error')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "try except pattern 126", | |
| "output": "try:\n x = 1/0\nexcept ZeroDivisionError:\n print('Cannot divide by zero')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 127", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 128", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "try except pattern 129", | |
| "output": "try:\n x = 1/0\nexcept ZeroDivisionError:\n print('Cannot divide by zero')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 130", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "multiple except pattern 131", | |
| "output": "try:\n result = int('abc')\nexcept ValueError:\n print('Invalid value')\nexcept TypeError:\n print('Type error')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "try except pattern 132", | |
| "output": "try:\n x = 1/0\nexcept ZeroDivisionError:\n print('Cannot divide by zero')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 133", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "try except pattern 134", | |
| "output": "try:\n x = 1/0\nexcept ZeroDivisionError:\n print('Cannot divide by zero')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "multiple except pattern 135", | |
| "output": "try:\n result = int('abc')\nexcept ValueError:\n print('Invalid value')\nexcept TypeError:\n print('Type error')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "multiple except pattern 136", | |
| "output": "try:\n result = int('abc')\nexcept ValueError:\n print('Invalid value')\nexcept TypeError:\n print('Type error')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "try except pattern 137", | |
| "output": "try:\n x = 1/0\nexcept ZeroDivisionError:\n print('Cannot divide by zero')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "multiple except pattern 138", | |
| "output": "try:\n result = int('abc')\nexcept ValueError:\n print('Invalid value')\nexcept TypeError:\n print('Type error')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 139", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "multiple except pattern 140", | |
| "output": "try:\n result = int('abc')\nexcept ValueError:\n print('Invalid value')\nexcept TypeError:\n print('Type error')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "multiple except pattern 141", | |
| "output": "try:\n result = int('abc')\nexcept ValueError:\n print('Invalid value')\nexcept TypeError:\n print('Type error')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 142", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 143", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 144", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "try except pattern 145", | |
| "output": "try:\n x = 1/0\nexcept ZeroDivisionError:\n print('Cannot divide by zero')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "multiple except pattern 146", | |
| "output": "try:\n result = int('abc')\nexcept ValueError:\n print('Invalid value')\nexcept TypeError:\n print('Type error')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "multiple except pattern 147", | |
| "output": "try:\n result = int('abc')\nexcept ValueError:\n print('Invalid value')\nexcept TypeError:\n print('Type error')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "multiple except pattern 148", | |
| "output": "try:\n result = int('abc')\nexcept ValueError:\n print('Invalid value')\nexcept TypeError:\n print('Type error')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "finally pattern 149", | |
| "output": "try:\n file = open('test.txt')\nexcept:\n print('File not found')\nfinally:\n print('Done')", | |
| "tags": [ | |
| "error_handling", | |
| "exceptions" | |
| ] | |
| }, | |
| { | |
| "input": "dict comprehension structure 0", | |
| "output": "squares = {x: x**2 for x in range(5)}", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "dict comprehension structure 1", | |
| "output": "squares = {x: x**2 for x in range(5)}", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "defaultdict structure 2", | |
| "output": "from collections import defaultdict\nd = defaultdict(list)\nd['key'].append('value')", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "namedtuple structure 3", | |
| "output": "from collections import namedtuple\nPoint = namedtuple('Point', ['x', 'y'])\np = Point(1, 2)", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "dict comprehension structure 4", | |
| "output": "squares = {x: x**2 for x in range(5)}", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "set operations structure 5", | |
| "output": "a = {1, 2, 3}\nb = {3, 4, 5}\nunion = a | b\nintersection = a & b", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "dict comprehension structure 6", | |
| "output": "squares = {x: x**2 for x in range(5)}", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "nested list structure 7", | |
| "output": "matrix = [[1, 2], [3, 4], [5, 6]]", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "nested list structure 8", | |
| "output": "matrix = [[1, 2], [3, 4], [5, 6]]", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "set operations structure 9", | |
| "output": "a = {1, 2, 3}\nb = {3, 4, 5}\nunion = a | b\nintersection = a & b", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "defaultdict structure 10", | |
| "output": "from collections import defaultdict\nd = defaultdict(list)\nd['key'].append('value')", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "namedtuple structure 11", | |
| "output": "from collections import namedtuple\nPoint = namedtuple('Point', ['x', 'y'])\np = Point(1, 2)", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "defaultdict structure 12", | |
| "output": "from collections import defaultdict\nd = defaultdict(list)\nd['key'].append('value')", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "nested list structure 13", | |
| "output": "matrix = [[1, 2], [3, 4], [5, 6]]", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "nested list structure 14", | |
| "output": "matrix = [[1, 2], [3, 4], [5, 6]]", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "defaultdict structure 15", | |
| "output": "from collections import defaultdict\nd = defaultdict(list)\nd['key'].append('value')", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "defaultdict structure 16", | |
| "output": "from collections import defaultdict\nd = defaultdict(list)\nd['key'].append('value')", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "defaultdict structure 17", | |
| "output": "from collections import defaultdict\nd = defaultdict(list)\nd['key'].append('value')", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "nested list structure 18", | |
| "output": "matrix = [[1, 2], [3, 4], [5, 6]]", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "nested list structure 19", | |
| "output": "matrix = [[1, 2], [3, 4], [5, 6]]", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "nested list structure 20", | |
| "output": "matrix = [[1, 2], [3, 4], [5, 6]]", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "defaultdict structure 21", | |
| "output": "from collections import defaultdict\nd = defaultdict(list)\nd['key'].append('value')", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "nested list structure 22", | |
| "output": "matrix = [[1, 2], [3, 4], [5, 6]]", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "nested list structure 23", | |
| "output": "matrix = [[1, 2], [3, 4], [5, 6]]", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "nested list structure 24", | |
| "output": "matrix = [[1, 2], [3, 4], [5, 6]]", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "namedtuple structure 25", | |
| "output": "from collections import namedtuple\nPoint = namedtuple('Point', ['x', 'y'])\np = Point(1, 2)", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "defaultdict structure 26", | |
| "output": "from collections import defaultdict\nd = defaultdict(list)\nd['key'].append('value')", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "namedtuple structure 27", | |
| "output": "from collections import namedtuple\nPoint = namedtuple('Point', ['x', 'y'])\np = Point(1, 2)", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "defaultdict structure 28", | |
| "output": "from collections import defaultdict\nd = defaultdict(list)\nd['key'].append('value')", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "defaultdict structure 29", | |
| "output": "from collections import defaultdict\nd = defaultdict(list)\nd['key'].append('value')", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "nested list structure 30", | |
| "output": "matrix = [[1, 2], [3, 4], [5, 6]]", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "nested list structure 31", | |
| "output": "matrix = [[1, 2], [3, 4], [5, 6]]", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "dict comprehension structure 32", | |
| "output": "squares = {x: x**2 for x in range(5)}", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "defaultdict structure 33", | |
| "output": "from collections import defaultdict\nd = defaultdict(list)\nd['key'].append('value')", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "defaultdict structure 34", | |
| "output": "from collections import defaultdict\nd = defaultdict(list)\nd['key'].append('value')", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "dict comprehension structure 35", | |
| "output": "squares = {x: x**2 for x in range(5)}", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "set operations structure 36", | |
| "output": "a = {1, 2, 3}\nb = {3, 4, 5}\nunion = a | b\nintersection = a & b", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "defaultdict structure 37", | |
| "output": "from collections import defaultdict\nd = defaultdict(list)\nd['key'].append('value')", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "dict comprehension structure 38", | |
| "output": "squares = {x: x**2 for x in range(5)}", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "dict comprehension structure 39", | |
| "output": "squares = {x: x**2 for x in range(5)}", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "namedtuple structure 40", | |
| "output": "from collections import namedtuple\nPoint = namedtuple('Point', ['x', 'y'])\np = Point(1, 2)", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "namedtuple structure 41", | |
| "output": "from collections import namedtuple\nPoint = namedtuple('Point', ['x', 'y'])\np = Point(1, 2)", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "nested list structure 42", | |
| "output": "matrix = [[1, 2], [3, 4], [5, 6]]", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "defaultdict structure 43", | |
| "output": "from collections import defaultdict\nd = defaultdict(list)\nd['key'].append('value')", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "dict comprehension structure 44", | |
| "output": "squares = {x: x**2 for x in range(5)}", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "defaultdict structure 45", | |
| "output": "from collections import defaultdict\nd = defaultdict(list)\nd['key'].append('value')", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "set operations structure 46", | |
| "output": "a = {1, 2, 3}\nb = {3, 4, 5}\nunion = a | b\nintersection = a & b", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "nested list structure 47", | |
| "output": "matrix = [[1, 2], [3, 4], [5, 6]]", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "defaultdict structure 48", | |
| "output": "from collections import defaultdict\nd = defaultdict(list)\nd['key'].append('value')", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "namedtuple structure 49", | |
| "output": "from collections import namedtuple\nPoint = namedtuple('Point', ['x', 'y'])\np = Point(1, 2)", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "defaultdict structure 50", | |
| "output": "from collections import defaultdict\nd = defaultdict(list)\nd['key'].append('value')", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "set operations structure 51", | |
| "output": "a = {1, 2, 3}\nb = {3, 4, 5}\nunion = a | b\nintersection = a & b", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "dict comprehension structure 52", | |
| "output": "squares = {x: x**2 for x in range(5)}", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "namedtuple structure 53", | |
| "output": "from collections import namedtuple\nPoint = namedtuple('Point', ['x', 'y'])\np = Point(1, 2)", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "nested list structure 54", | |
| "output": "matrix = [[1, 2], [3, 4], [5, 6]]", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "namedtuple structure 55", | |
| "output": "from collections import namedtuple\nPoint = namedtuple('Point', ['x', 'y'])\np = Point(1, 2)", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "nested list structure 56", | |
| "output": "matrix = [[1, 2], [3, 4], [5, 6]]", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "nested list structure 57", | |
| "output": "matrix = [[1, 2], [3, 4], [5, 6]]", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "dict comprehension structure 58", | |
| "output": "squares = {x: x**2 for x in range(5)}", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "nested list structure 59", | |
| "output": "matrix = [[1, 2], [3, 4], [5, 6]]", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "namedtuple structure 60", | |
| "output": "from collections import namedtuple\nPoint = namedtuple('Point', ['x', 'y'])\np = Point(1, 2)", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "dict comprehension structure 61", | |
| "output": "squares = {x: x**2 for x in range(5)}", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "nested list structure 62", | |
| "output": "matrix = [[1, 2], [3, 4], [5, 6]]", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "dict comprehension structure 63", | |
| "output": "squares = {x: x**2 for x in range(5)}", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "set operations structure 64", | |
| "output": "a = {1, 2, 3}\nb = {3, 4, 5}\nunion = a | b\nintersection = a & b", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "dict comprehension structure 65", | |
| "output": "squares = {x: x**2 for x in range(5)}", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "defaultdict structure 66", | |
| "output": "from collections import defaultdict\nd = defaultdict(list)\nd['key'].append('value')", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "set operations structure 67", | |
| "output": "a = {1, 2, 3}\nb = {3, 4, 5}\nunion = a | b\nintersection = a & b", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "defaultdict structure 68", | |
| "output": "from collections import defaultdict\nd = defaultdict(list)\nd['key'].append('value')", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "nested list structure 69", | |
| "output": "matrix = [[1, 2], [3, 4], [5, 6]]", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "set operations structure 70", | |
| "output": "a = {1, 2, 3}\nb = {3, 4, 5}\nunion = a | b\nintersection = a & b", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "nested list structure 71", | |
| "output": "matrix = [[1, 2], [3, 4], [5, 6]]", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "dict comprehension structure 72", | |
| "output": "squares = {x: x**2 for x in range(5)}", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "dict comprehension structure 73", | |
| "output": "squares = {x: x**2 for x in range(5)}", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "nested list structure 74", | |
| "output": "matrix = [[1, 2], [3, 4], [5, 6]]", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "dict comprehension structure 75", | |
| "output": "squares = {x: x**2 for x in range(5)}", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "defaultdict structure 76", | |
| "output": "from collections import defaultdict\nd = defaultdict(list)\nd['key'].append('value')", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "set operations structure 77", | |
| "output": "a = {1, 2, 3}\nb = {3, 4, 5}\nunion = a | b\nintersection = a & b", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "namedtuple structure 78", | |
| "output": "from collections import namedtuple\nPoint = namedtuple('Point', ['x', 'y'])\np = Point(1, 2)", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "set operations structure 79", | |
| "output": "a = {1, 2, 3}\nb = {3, 4, 5}\nunion = a | b\nintersection = a & b", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "nested list structure 80", | |
| "output": "matrix = [[1, 2], [3, 4], [5, 6]]", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "nested list structure 81", | |
| "output": "matrix = [[1, 2], [3, 4], [5, 6]]", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "namedtuple structure 82", | |
| "output": "from collections import namedtuple\nPoint = namedtuple('Point', ['x', 'y'])\np = Point(1, 2)", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "set operations structure 83", | |
| "output": "a = {1, 2, 3}\nb = {3, 4, 5}\nunion = a | b\nintersection = a & b", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "dict comprehension structure 84", | |
| "output": "squares = {x: x**2 for x in range(5)}", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "defaultdict structure 85", | |
| "output": "from collections import defaultdict\nd = defaultdict(list)\nd['key'].append('value')", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "set operations structure 86", | |
| "output": "a = {1, 2, 3}\nb = {3, 4, 5}\nunion = a | b\nintersection = a & b", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "namedtuple structure 87", | |
| "output": "from collections import namedtuple\nPoint = namedtuple('Point', ['x', 'y'])\np = Point(1, 2)", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "namedtuple structure 88", | |
| "output": "from collections import namedtuple\nPoint = namedtuple('Point', ['x', 'y'])\np = Point(1, 2)", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "defaultdict structure 89", | |
| "output": "from collections import defaultdict\nd = defaultdict(list)\nd['key'].append('value')", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "defaultdict structure 90", | |
| "output": "from collections import defaultdict\nd = defaultdict(list)\nd['key'].append('value')", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "set operations structure 91", | |
| "output": "a = {1, 2, 3}\nb = {3, 4, 5}\nunion = a | b\nintersection = a & b", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "nested list structure 92", | |
| "output": "matrix = [[1, 2], [3, 4], [5, 6]]", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "dict comprehension structure 93", | |
| "output": "squares = {x: x**2 for x in range(5)}", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "defaultdict structure 94", | |
| "output": "from collections import defaultdict\nd = defaultdict(list)\nd['key'].append('value')", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "dict comprehension structure 95", | |
| "output": "squares = {x: x**2 for x in range(5)}", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "namedtuple structure 96", | |
| "output": "from collections import namedtuple\nPoint = namedtuple('Point', ['x', 'y'])\np = Point(1, 2)", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "namedtuple structure 97", | |
| "output": "from collections import namedtuple\nPoint = namedtuple('Point', ['x', 'y'])\np = Point(1, 2)", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "set operations structure 98", | |
| "output": "a = {1, 2, 3}\nb = {3, 4, 5}\nunion = a | b\nintersection = a & b", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "defaultdict structure 99", | |
| "output": "from collections import defaultdict\nd = defaultdict(list)\nd['key'].append('value')", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "namedtuple structure 100", | |
| "output": "from collections import namedtuple\nPoint = namedtuple('Point', ['x', 'y'])\np = Point(1, 2)", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "dict comprehension structure 101", | |
| "output": "squares = {x: x**2 for x in range(5)}", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "defaultdict structure 102", | |
| "output": "from collections import defaultdict\nd = defaultdict(list)\nd['key'].append('value')", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "defaultdict structure 103", | |
| "output": "from collections import defaultdict\nd = defaultdict(list)\nd['key'].append('value')", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "defaultdict structure 104", | |
| "output": "from collections import defaultdict\nd = defaultdict(list)\nd['key'].append('value')", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "namedtuple structure 105", | |
| "output": "from collections import namedtuple\nPoint = namedtuple('Point', ['x', 'y'])\np = Point(1, 2)", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "namedtuple structure 106", | |
| "output": "from collections import namedtuple\nPoint = namedtuple('Point', ['x', 'y'])\np = Point(1, 2)", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "defaultdict structure 107", | |
| "output": "from collections import defaultdict\nd = defaultdict(list)\nd['key'].append('value')", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "nested list structure 108", | |
| "output": "matrix = [[1, 2], [3, 4], [5, 6]]", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "set operations structure 109", | |
| "output": "a = {1, 2, 3}\nb = {3, 4, 5}\nunion = a | b\nintersection = a & b", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "defaultdict structure 110", | |
| "output": "from collections import defaultdict\nd = defaultdict(list)\nd['key'].append('value')", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "set operations structure 111", | |
| "output": "a = {1, 2, 3}\nb = {3, 4, 5}\nunion = a | b\nintersection = a & b", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "defaultdict structure 112", | |
| "output": "from collections import defaultdict\nd = defaultdict(list)\nd['key'].append('value')", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "dict comprehension structure 113", | |
| "output": "squares = {x: x**2 for x in range(5)}", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "set operations structure 114", | |
| "output": "a = {1, 2, 3}\nb = {3, 4, 5}\nunion = a | b\nintersection = a & b", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "dict comprehension structure 115", | |
| "output": "squares = {x: x**2 for x in range(5)}", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "dict comprehension structure 116", | |
| "output": "squares = {x: x**2 for x in range(5)}", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "nested list structure 117", | |
| "output": "matrix = [[1, 2], [3, 4], [5, 6]]", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "namedtuple structure 118", | |
| "output": "from collections import namedtuple\nPoint = namedtuple('Point', ['x', 'y'])\np = Point(1, 2)", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "set operations structure 119", | |
| "output": "a = {1, 2, 3}\nb = {3, 4, 5}\nunion = a | b\nintersection = a & b", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "set operations structure 120", | |
| "output": "a = {1, 2, 3}\nb = {3, 4, 5}\nunion = a | b\nintersection = a & b", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "nested list structure 121", | |
| "output": "matrix = [[1, 2], [3, 4], [5, 6]]", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "defaultdict structure 122", | |
| "output": "from collections import defaultdict\nd = defaultdict(list)\nd['key'].append('value')", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "defaultdict structure 123", | |
| "output": "from collections import defaultdict\nd = defaultdict(list)\nd['key'].append('value')", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "defaultdict structure 124", | |
| "output": "from collections import defaultdict\nd = defaultdict(list)\nd['key'].append('value')", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "namedtuple structure 125", | |
| "output": "from collections import namedtuple\nPoint = namedtuple('Point', ['x', 'y'])\np = Point(1, 2)", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "nested list structure 126", | |
| "output": "matrix = [[1, 2], [3, 4], [5, 6]]", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "defaultdict structure 127", | |
| "output": "from collections import defaultdict\nd = defaultdict(list)\nd['key'].append('value')", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "set operations structure 128", | |
| "output": "a = {1, 2, 3}\nb = {3, 4, 5}\nunion = a | b\nintersection = a & b", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "namedtuple structure 129", | |
| "output": "from collections import namedtuple\nPoint = namedtuple('Point', ['x', 'y'])\np = Point(1, 2)", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "set operations structure 130", | |
| "output": "a = {1, 2, 3}\nb = {3, 4, 5}\nunion = a | b\nintersection = a & b", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "namedtuple structure 131", | |
| "output": "from collections import namedtuple\nPoint = namedtuple('Point', ['x', 'y'])\np = Point(1, 2)", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "nested list structure 132", | |
| "output": "matrix = [[1, 2], [3, 4], [5, 6]]", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "nested list structure 133", | |
| "output": "matrix = [[1, 2], [3, 4], [5, 6]]", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "namedtuple structure 134", | |
| "output": "from collections import namedtuple\nPoint = namedtuple('Point', ['x', 'y'])\np = Point(1, 2)", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "set operations structure 135", | |
| "output": "a = {1, 2, 3}\nb = {3, 4, 5}\nunion = a | b\nintersection = a & b", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "defaultdict structure 136", | |
| "output": "from collections import defaultdict\nd = defaultdict(list)\nd['key'].append('value')", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "defaultdict structure 137", | |
| "output": "from collections import defaultdict\nd = defaultdict(list)\nd['key'].append('value')", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "nested list structure 138", | |
| "output": "matrix = [[1, 2], [3, 4], [5, 6]]", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "dict comprehension structure 139", | |
| "output": "squares = {x: x**2 for x in range(5)}", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "dict comprehension structure 140", | |
| "output": "squares = {x: x**2 for x in range(5)}", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "set operations structure 141", | |
| "output": "a = {1, 2, 3}\nb = {3, 4, 5}\nunion = a | b\nintersection = a & b", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "defaultdict structure 142", | |
| "output": "from collections import defaultdict\nd = defaultdict(list)\nd['key'].append('value')", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "namedtuple structure 143", | |
| "output": "from collections import namedtuple\nPoint = namedtuple('Point', ['x', 'y'])\np = Point(1, 2)", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "defaultdict structure 144", | |
| "output": "from collections import defaultdict\nd = defaultdict(list)\nd['key'].append('value')", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "namedtuple structure 145", | |
| "output": "from collections import namedtuple\nPoint = namedtuple('Point', ['x', 'y'])\np = Point(1, 2)", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "namedtuple structure 146", | |
| "output": "from collections import namedtuple\nPoint = namedtuple('Point', ['x', 'y'])\np = Point(1, 2)", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "dict comprehension structure 147", | |
| "output": "squares = {x: x**2 for x in range(5)}", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "nested list structure 148", | |
| "output": "matrix = [[1, 2], [3, 4], [5, 6]]", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "defaultdict structure 149", | |
| "output": "from collections import defaultdict\nd = defaultdict(list)\nd['key'].append('value')", | |
| "tags": [ | |
| "data_structures", | |
| "collections" | |
| ] | |
| }, | |
| { | |
| "input": "append file operation 0", | |
| "output": "with open('file.txt', 'a') as f:\n f.write('\\nNew line')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "read file operation 1", | |
| "output": "with open('file.txt', 'r') as f:\n content = f.read()", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "read file operation 2", | |
| "output": "with open('file.txt', 'r') as f:\n content = f.read()", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "append file operation 3", | |
| "output": "with open('file.txt', 'a') as f:\n f.write('\\nNew line')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "read lines operation 4", | |
| "output": "with open('file.txt', 'r') as f:\n lines = f.readlines()", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "read lines operation 5", | |
| "output": "with open('file.txt', 'r') as f:\n lines = f.readlines()", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "write file operation 6", | |
| "output": "with open('file.txt', 'w') as f:\n f.write('Hello')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "write file operation 7", | |
| "output": "with open('file.txt', 'w') as f:\n f.write('Hello')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "read file operation 8", | |
| "output": "with open('file.txt', 'r') as f:\n content = f.read()", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "write file operation 9", | |
| "output": "with open('file.txt', 'w') as f:\n f.write('Hello')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "read lines operation 10", | |
| "output": "with open('file.txt', 'r') as f:\n lines = f.readlines()", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "read lines operation 11", | |
| "output": "with open('file.txt', 'r') as f:\n lines = f.readlines()", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "write file operation 12", | |
| "output": "with open('file.txt', 'w') as f:\n f.write('Hello')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "append file operation 13", | |
| "output": "with open('file.txt', 'a') as f:\n f.write('\\nNew line')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "read file operation 14", | |
| "output": "with open('file.txt', 'r') as f:\n content = f.read()", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "read lines operation 15", | |
| "output": "with open('file.txt', 'r') as f:\n lines = f.readlines()", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "read file operation 16", | |
| "output": "with open('file.txt', 'r') as f:\n content = f.read()", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "append file operation 17", | |
| "output": "with open('file.txt', 'a') as f:\n f.write('\\nNew line')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "write file operation 18", | |
| "output": "with open('file.txt', 'w') as f:\n f.write('Hello')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "read file operation 19", | |
| "output": "with open('file.txt', 'r') as f:\n content = f.read()", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "append file operation 20", | |
| "output": "with open('file.txt', 'a') as f:\n f.write('\\nNew line')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "write file operation 21", | |
| "output": "with open('file.txt', 'w') as f:\n f.write('Hello')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "read file operation 22", | |
| "output": "with open('file.txt', 'r') as f:\n content = f.read()", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "read file operation 23", | |
| "output": "with open('file.txt', 'r') as f:\n content = f.read()", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "write file operation 24", | |
| "output": "with open('file.txt', 'w') as f:\n f.write('Hello')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "read file operation 25", | |
| "output": "with open('file.txt', 'r') as f:\n content = f.read()", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "append file operation 26", | |
| "output": "with open('file.txt', 'a') as f:\n f.write('\\nNew line')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "append file operation 27", | |
| "output": "with open('file.txt', 'a') as f:\n f.write('\\nNew line')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "write file operation 28", | |
| "output": "with open('file.txt', 'w') as f:\n f.write('Hello')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "write file operation 29", | |
| "output": "with open('file.txt', 'w') as f:\n f.write('Hello')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "append file operation 30", | |
| "output": "with open('file.txt', 'a') as f:\n f.write('\\nNew line')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "read file operation 31", | |
| "output": "with open('file.txt', 'r') as f:\n content = f.read()", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "append file operation 32", | |
| "output": "with open('file.txt', 'a') as f:\n f.write('\\nNew line')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "read file operation 33", | |
| "output": "with open('file.txt', 'r') as f:\n content = f.read()", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "append file operation 34", | |
| "output": "with open('file.txt', 'a') as f:\n f.write('\\nNew line')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "write file operation 35", | |
| "output": "with open('file.txt', 'w') as f:\n f.write('Hello')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "append file operation 36", | |
| "output": "with open('file.txt', 'a') as f:\n f.write('\\nNew line')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "write file operation 37", | |
| "output": "with open('file.txt', 'w') as f:\n f.write('Hello')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "read file operation 38", | |
| "output": "with open('file.txt', 'r') as f:\n content = f.read()", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "read lines operation 39", | |
| "output": "with open('file.txt', 'r') as f:\n lines = f.readlines()", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "write file operation 40", | |
| "output": "with open('file.txt', 'w') as f:\n f.write('Hello')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "write file operation 41", | |
| "output": "with open('file.txt', 'w') as f:\n f.write('Hello')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "append file operation 42", | |
| "output": "with open('file.txt', 'a') as f:\n f.write('\\nNew line')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "write file operation 43", | |
| "output": "with open('file.txt', 'w') as f:\n f.write('Hello')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "append file operation 44", | |
| "output": "with open('file.txt', 'a') as f:\n f.write('\\nNew line')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "read file operation 45", | |
| "output": "with open('file.txt', 'r') as f:\n content = f.read()", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "read lines operation 46", | |
| "output": "with open('file.txt', 'r') as f:\n lines = f.readlines()", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "write file operation 47", | |
| "output": "with open('file.txt', 'w') as f:\n f.write('Hello')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "write file operation 48", | |
| "output": "with open('file.txt', 'w') as f:\n f.write('Hello')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "write file operation 49", | |
| "output": "with open('file.txt', 'w') as f:\n f.write('Hello')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "read file operation 50", | |
| "output": "with open('file.txt', 'r') as f:\n content = f.read()", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "read lines operation 51", | |
| "output": "with open('file.txt', 'r') as f:\n lines = f.readlines()", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "read file operation 52", | |
| "output": "with open('file.txt', 'r') as f:\n content = f.read()", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "read lines operation 53", | |
| "output": "with open('file.txt', 'r') as f:\n lines = f.readlines()", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "read file operation 54", | |
| "output": "with open('file.txt', 'r') as f:\n content = f.read()", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "write file operation 55", | |
| "output": "with open('file.txt', 'w') as f:\n f.write('Hello')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "append file operation 56", | |
| "output": "with open('file.txt', 'a') as f:\n f.write('\\nNew line')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "append file operation 57", | |
| "output": "with open('file.txt', 'a') as f:\n f.write('\\nNew line')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "read file operation 58", | |
| "output": "with open('file.txt', 'r') as f:\n content = f.read()", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "write file operation 59", | |
| "output": "with open('file.txt', 'w') as f:\n f.write('Hello')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "append file operation 60", | |
| "output": "with open('file.txt', 'a') as f:\n f.write('\\nNew line')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "read file operation 61", | |
| "output": "with open('file.txt', 'r') as f:\n content = f.read()", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "append file operation 62", | |
| "output": "with open('file.txt', 'a') as f:\n f.write('\\nNew line')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "read lines operation 63", | |
| "output": "with open('file.txt', 'r') as f:\n lines = f.readlines()", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "read file operation 64", | |
| "output": "with open('file.txt', 'r') as f:\n content = f.read()", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "read file operation 65", | |
| "output": "with open('file.txt', 'r') as f:\n content = f.read()", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "read lines operation 66", | |
| "output": "with open('file.txt', 'r') as f:\n lines = f.readlines()", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "read file operation 67", | |
| "output": "with open('file.txt', 'r') as f:\n content = f.read()", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "read lines operation 68", | |
| "output": "with open('file.txt', 'r') as f:\n lines = f.readlines()", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "write file operation 69", | |
| "output": "with open('file.txt', 'w') as f:\n f.write('Hello')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "write file operation 70", | |
| "output": "with open('file.txt', 'w') as f:\n f.write('Hello')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "read lines operation 71", | |
| "output": "with open('file.txt', 'r') as f:\n lines = f.readlines()", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "read lines operation 72", | |
| "output": "with open('file.txt', 'r') as f:\n lines = f.readlines()", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "write file operation 73", | |
| "output": "with open('file.txt', 'w') as f:\n f.write('Hello')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "write file operation 74", | |
| "output": "with open('file.txt', 'w') as f:\n f.write('Hello')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "append file operation 75", | |
| "output": "with open('file.txt', 'a') as f:\n f.write('\\nNew line')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "write file operation 76", | |
| "output": "with open('file.txt', 'w') as f:\n f.write('Hello')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "append file operation 77", | |
| "output": "with open('file.txt', 'a') as f:\n f.write('\\nNew line')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "write file operation 78", | |
| "output": "with open('file.txt', 'w') as f:\n f.write('Hello')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "read file operation 79", | |
| "output": "with open('file.txt', 'r') as f:\n content = f.read()", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "write file operation 80", | |
| "output": "with open('file.txt', 'w') as f:\n f.write('Hello')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "append file operation 81", | |
| "output": "with open('file.txt', 'a') as f:\n f.write('\\nNew line')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "write file operation 82", | |
| "output": "with open('file.txt', 'w') as f:\n f.write('Hello')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "append file operation 83", | |
| "output": "with open('file.txt', 'a') as f:\n f.write('\\nNew line')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "write file operation 84", | |
| "output": "with open('file.txt', 'w') as f:\n f.write('Hello')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "write file operation 85", | |
| "output": "with open('file.txt', 'w') as f:\n f.write('Hello')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "append file operation 86", | |
| "output": "with open('file.txt', 'a') as f:\n f.write('\\nNew line')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "write file operation 87", | |
| "output": "with open('file.txt', 'w') as f:\n f.write('Hello')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "write file operation 88", | |
| "output": "with open('file.txt', 'w') as f:\n f.write('Hello')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "read file operation 89", | |
| "output": "with open('file.txt', 'r') as f:\n content = f.read()", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "read lines operation 90", | |
| "output": "with open('file.txt', 'r') as f:\n lines = f.readlines()", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "read lines operation 91", | |
| "output": "with open('file.txt', 'r') as f:\n lines = f.readlines()", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "read lines operation 92", | |
| "output": "with open('file.txt', 'r') as f:\n lines = f.readlines()", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "write file operation 93", | |
| "output": "with open('file.txt', 'w') as f:\n f.write('Hello')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "read file operation 94", | |
| "output": "with open('file.txt', 'r') as f:\n content = f.read()", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "read file operation 95", | |
| "output": "with open('file.txt', 'r') as f:\n content = f.read()", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "read file operation 96", | |
| "output": "with open('file.txt', 'r') as f:\n content = f.read()", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "read lines operation 97", | |
| "output": "with open('file.txt', 'r') as f:\n lines = f.readlines()", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "read lines operation 98", | |
| "output": "with open('file.txt', 'r') as f:\n lines = f.readlines()", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "write file operation 99", | |
| "output": "with open('file.txt', 'w') as f:\n f.write('Hello')", | |
| "tags": [ | |
| "file_io", | |
| "io" | |
| ] | |
| }, | |
| { | |
| "input": "context manager advanced 0", | |
| "output": "class Manager:\n def __enter__(self):\n return self\n def __exit__(self, *args):\n pass", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "simple decorator advanced 1", | |
| "output": "def decorator(func):\n def wrapper():\n print('Before')\n func()\n print('After')\n return wrapper", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "context manager advanced 2", | |
| "output": "class Manager:\n def __enter__(self):\n return self\n def __exit__(self, *args):\n pass", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "generator advanced 3", | |
| "output": "def gen():\n for i in range(5):\n yield i", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "generator advanced 4", | |
| "output": "def gen():\n for i in range(5):\n yield i", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "generator advanced 5", | |
| "output": "def gen():\n for i in range(5):\n yield i", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "context manager advanced 6", | |
| "output": "class Manager:\n def __enter__(self):\n return self\n def __exit__(self, *args):\n pass", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "context manager advanced 7", | |
| "output": "class Manager:\n def __enter__(self):\n return self\n def __exit__(self, *args):\n pass", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "context manager advanced 8", | |
| "output": "class Manager:\n def __enter__(self):\n return self\n def __exit__(self, *args):\n pass", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "simple decorator advanced 9", | |
| "output": "def decorator(func):\n def wrapper():\n print('Before')\n func()\n print('After')\n return wrapper", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "simple decorator advanced 10", | |
| "output": "def decorator(func):\n def wrapper():\n print('Before')\n func()\n print('After')\n return wrapper", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "simple decorator advanced 11", | |
| "output": "def decorator(func):\n def wrapper():\n print('Before')\n func()\n print('After')\n return wrapper", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "simple decorator advanced 12", | |
| "output": "def decorator(func):\n def wrapper():\n print('Before')\n func()\n print('After')\n return wrapper", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "context manager advanced 13", | |
| "output": "class Manager:\n def __enter__(self):\n return self\n def __exit__(self, *args):\n pass", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "context manager advanced 14", | |
| "output": "class Manager:\n def __enter__(self):\n return self\n def __exit__(self, *args):\n pass", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "context manager advanced 15", | |
| "output": "class Manager:\n def __enter__(self):\n return self\n def __exit__(self, *args):\n pass", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "context manager advanced 16", | |
| "output": "class Manager:\n def __enter__(self):\n return self\n def __exit__(self, *args):\n pass", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "simple decorator advanced 17", | |
| "output": "def decorator(func):\n def wrapper():\n print('Before')\n func()\n print('After')\n return wrapper", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "context manager advanced 18", | |
| "output": "class Manager:\n def __enter__(self):\n return self\n def __exit__(self, *args):\n pass", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "context manager advanced 19", | |
| "output": "class Manager:\n def __enter__(self):\n return self\n def __exit__(self, *args):\n pass", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "generator advanced 20", | |
| "output": "def gen():\n for i in range(5):\n yield i", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "generator advanced 21", | |
| "output": "def gen():\n for i in range(5):\n yield i", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "simple decorator advanced 22", | |
| "output": "def decorator(func):\n def wrapper():\n print('Before')\n func()\n print('After')\n return wrapper", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "simple decorator advanced 23", | |
| "output": "def decorator(func):\n def wrapper():\n print('Before')\n func()\n print('After')\n return wrapper", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "simple decorator advanced 24", | |
| "output": "def decorator(func):\n def wrapper():\n print('Before')\n func()\n print('After')\n return wrapper", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "context manager advanced 25", | |
| "output": "class Manager:\n def __enter__(self):\n return self\n def __exit__(self, *args):\n pass", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "generator advanced 26", | |
| "output": "def gen():\n for i in range(5):\n yield i", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "context manager advanced 27", | |
| "output": "class Manager:\n def __enter__(self):\n return self\n def __exit__(self, *args):\n pass", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "context manager advanced 28", | |
| "output": "class Manager:\n def __enter__(self):\n return self\n def __exit__(self, *args):\n pass", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "generator advanced 29", | |
| "output": "def gen():\n for i in range(5):\n yield i", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "simple decorator advanced 30", | |
| "output": "def decorator(func):\n def wrapper():\n print('Before')\n func()\n print('After')\n return wrapper", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "context manager advanced 31", | |
| "output": "class Manager:\n def __enter__(self):\n return self\n def __exit__(self, *args):\n pass", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "simple decorator advanced 32", | |
| "output": "def decorator(func):\n def wrapper():\n print('Before')\n func()\n print('After')\n return wrapper", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "context manager advanced 33", | |
| "output": "class Manager:\n def __enter__(self):\n return self\n def __exit__(self, *args):\n pass", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "generator advanced 34", | |
| "output": "def gen():\n for i in range(5):\n yield i", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "simple decorator advanced 35", | |
| "output": "def decorator(func):\n def wrapper():\n print('Before')\n func()\n print('After')\n return wrapper", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "generator advanced 36", | |
| "output": "def gen():\n for i in range(5):\n yield i", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "context manager advanced 37", | |
| "output": "class Manager:\n def __enter__(self):\n return self\n def __exit__(self, *args):\n pass", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "context manager advanced 38", | |
| "output": "class Manager:\n def __enter__(self):\n return self\n def __exit__(self, *args):\n pass", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "context manager advanced 39", | |
| "output": "class Manager:\n def __enter__(self):\n return self\n def __exit__(self, *args):\n pass", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "simple decorator advanced 40", | |
| "output": "def decorator(func):\n def wrapper():\n print('Before')\n func()\n print('After')\n return wrapper", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "context manager advanced 41", | |
| "output": "class Manager:\n def __enter__(self):\n return self\n def __exit__(self, *args):\n pass", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "simple decorator advanced 42", | |
| "output": "def decorator(func):\n def wrapper():\n print('Before')\n func()\n print('After')\n return wrapper", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "context manager advanced 43", | |
| "output": "class Manager:\n def __enter__(self):\n return self\n def __exit__(self, *args):\n pass", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "simple decorator advanced 44", | |
| "output": "def decorator(func):\n def wrapper():\n print('Before')\n func()\n print('After')\n return wrapper", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "generator advanced 45", | |
| "output": "def gen():\n for i in range(5):\n yield i", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "generator advanced 46", | |
| "output": "def gen():\n for i in range(5):\n yield i", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "context manager advanced 47", | |
| "output": "class Manager:\n def __enter__(self):\n return self\n def __exit__(self, *args):\n pass", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "context manager advanced 48", | |
| "output": "class Manager:\n def __enter__(self):\n return self\n def __exit__(self, *args):\n pass", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "generator advanced 49", | |
| "output": "def gen():\n for i in range(5):\n yield i", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "simple decorator advanced 50", | |
| "output": "def decorator(func):\n def wrapper():\n print('Before')\n func()\n print('After')\n return wrapper", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "simple decorator advanced 51", | |
| "output": "def decorator(func):\n def wrapper():\n print('Before')\n func()\n print('After')\n return wrapper", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "simple decorator advanced 52", | |
| "output": "def decorator(func):\n def wrapper():\n print('Before')\n func()\n print('After')\n return wrapper", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "context manager advanced 53", | |
| "output": "class Manager:\n def __enter__(self):\n return self\n def __exit__(self, *args):\n pass", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "context manager advanced 54", | |
| "output": "class Manager:\n def __enter__(self):\n return self\n def __exit__(self, *args):\n pass", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "simple decorator advanced 55", | |
| "output": "def decorator(func):\n def wrapper():\n print('Before')\n func()\n print('After')\n return wrapper", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "context manager advanced 56", | |
| "output": "class Manager:\n def __enter__(self):\n return self\n def __exit__(self, *args):\n pass", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "generator advanced 57", | |
| "output": "def gen():\n for i in range(5):\n yield i", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "simple decorator advanced 58", | |
| "output": "def decorator(func):\n def wrapper():\n print('Before')\n func()\n print('After')\n return wrapper", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "simple decorator advanced 59", | |
| "output": "def decorator(func):\n def wrapper():\n print('Before')\n func()\n print('After')\n return wrapper", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "simple decorator advanced 60", | |
| "output": "def decorator(func):\n def wrapper():\n print('Before')\n func()\n print('After')\n return wrapper", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "context manager advanced 61", | |
| "output": "class Manager:\n def __enter__(self):\n return self\n def __exit__(self, *args):\n pass", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "simple decorator advanced 62", | |
| "output": "def decorator(func):\n def wrapper():\n print('Before')\n func()\n print('After')\n return wrapper", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "simple decorator advanced 63", | |
| "output": "def decorator(func):\n def wrapper():\n print('Before')\n func()\n print('After')\n return wrapper", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "generator advanced 64", | |
| "output": "def gen():\n for i in range(5):\n yield i", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "context manager advanced 65", | |
| "output": "class Manager:\n def __enter__(self):\n return self\n def __exit__(self, *args):\n pass", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "context manager advanced 66", | |
| "output": "class Manager:\n def __enter__(self):\n return self\n def __exit__(self, *args):\n pass", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "generator advanced 67", | |
| "output": "def gen():\n for i in range(5):\n yield i", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "context manager advanced 68", | |
| "output": "class Manager:\n def __enter__(self):\n return self\n def __exit__(self, *args):\n pass", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "context manager advanced 69", | |
| "output": "class Manager:\n def __enter__(self):\n return self\n def __exit__(self, *args):\n pass", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "context manager advanced 70", | |
| "output": "class Manager:\n def __enter__(self):\n return self\n def __exit__(self, *args):\n pass", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "context manager advanced 71", | |
| "output": "class Manager:\n def __enter__(self):\n return self\n def __exit__(self, *args):\n pass", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "generator advanced 72", | |
| "output": "def gen():\n for i in range(5):\n yield i", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "simple decorator advanced 73", | |
| "output": "def decorator(func):\n def wrapper():\n print('Before')\n func()\n print('After')\n return wrapper", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "simple decorator advanced 74", | |
| "output": "def decorator(func):\n def wrapper():\n print('Before')\n func()\n print('After')\n return wrapper", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "generator advanced 75", | |
| "output": "def gen():\n for i in range(5):\n yield i", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "context manager advanced 76", | |
| "output": "class Manager:\n def __enter__(self):\n return self\n def __exit__(self, *args):\n pass", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "generator advanced 77", | |
| "output": "def gen():\n for i in range(5):\n yield i", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "simple decorator advanced 78", | |
| "output": "def decorator(func):\n def wrapper():\n print('Before')\n func()\n print('After')\n return wrapper", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "context manager advanced 79", | |
| "output": "class Manager:\n def __enter__(self):\n return self\n def __exit__(self, *args):\n pass", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "context manager advanced 80", | |
| "output": "class Manager:\n def __enter__(self):\n return self\n def __exit__(self, *args):\n pass", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "generator advanced 81", | |
| "output": "def gen():\n for i in range(5):\n yield i", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "simple decorator advanced 82", | |
| "output": "def decorator(func):\n def wrapper():\n print('Before')\n func()\n print('After')\n return wrapper", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "simple decorator advanced 83", | |
| "output": "def decorator(func):\n def wrapper():\n print('Before')\n func()\n print('After')\n return wrapper", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "simple decorator advanced 84", | |
| "output": "def decorator(func):\n def wrapper():\n print('Before')\n func()\n print('After')\n return wrapper", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "context manager advanced 85", | |
| "output": "class Manager:\n def __enter__(self):\n return self\n def __exit__(self, *args):\n pass", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "simple decorator advanced 86", | |
| "output": "def decorator(func):\n def wrapper():\n print('Before')\n func()\n print('After')\n return wrapper", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "simple decorator advanced 87", | |
| "output": "def decorator(func):\n def wrapper():\n print('Before')\n func()\n print('After')\n return wrapper", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "generator advanced 88", | |
| "output": "def gen():\n for i in range(5):\n yield i", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "context manager advanced 89", | |
| "output": "class Manager:\n def __enter__(self):\n return self\n def __exit__(self, *args):\n pass", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "generator advanced 90", | |
| "output": "def gen():\n for i in range(5):\n yield i", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "simple decorator advanced 91", | |
| "output": "def decorator(func):\n def wrapper():\n print('Before')\n func()\n print('After')\n return wrapper", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "simple decorator advanced 92", | |
| "output": "def decorator(func):\n def wrapper():\n print('Before')\n func()\n print('After')\n return wrapper", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "generator advanced 93", | |
| "output": "def gen():\n for i in range(5):\n yield i", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "generator advanced 94", | |
| "output": "def gen():\n for i in range(5):\n yield i", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "context manager advanced 95", | |
| "output": "class Manager:\n def __enter__(self):\n return self\n def __exit__(self, *args):\n pass", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "generator advanced 96", | |
| "output": "def gen():\n for i in range(5):\n yield i", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "generator advanced 97", | |
| "output": "def gen():\n for i in range(5):\n yield i", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "generator advanced 98", | |
| "output": "def gen():\n for i in range(5):\n yield i", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| }, | |
| { | |
| "input": "simple decorator advanced 99", | |
| "output": "def decorator(func):\n def wrapper():\n print('Before')\n func()\n print('After')\n return wrapper", | |
| "tags": [ | |
| "advanced", | |
| "decorators" | |
| ] | |
| } | |
| ] | |
| } |