|
1 | | -{ |
2 | | - "language": "Python", |
3 | | - "categories": [ |
4 | | - { |
5 | | - "categoryName": "File Handling", |
6 | | - "snippets": [ |
7 | | - { |
8 | | - "title": "Read a File", |
9 | | - "description": "Reads the entire content of a file.", |
10 | | - "code": "with open('file.txt', 'r') as file:\n content = file.read()\n print(content)", |
11 | | - "tags": ["file", "read", "python"], |
12 | | - "author": "@technoph1le", |
13 | | - "dateAdded": "2024-10-23" |
14 | | - }, |
15 | | - { |
16 | | - "title": "Write to a File", |
17 | | - "description": "Writes a string to a file.", |
18 | | - "code": "with open('file.txt', 'w') as file:\n file.write('Hello, World!')", |
19 | | - "tags": ["file", "write", "python"], |
20 | | - "author": "@technoph1le", |
21 | | - "dateAdded": "2024-10-23" |
22 | | - } |
23 | | - ] |
24 | | - }, |
25 | | - { |
26 | | - "categoryName": "Data Structures", |
27 | | - "snippets": [ |
28 | | - { |
29 | | - "title": "Reverse a List", |
30 | | - "description": "Reverses a list using slicing.", |
31 | | - "code": "my_list = [1, 2, 3, 4, 5]\nreversed_list = my_list[::-1]\nprint(reversed_list)", |
32 | | - "tags": ["list", "reverse", "python"], |
33 | | - "author": "@technoph1le", |
34 | | - "dateAdded": "2024-10-23" |
35 | | - }, |
36 | | - { |
37 | | - "title": "Dictionary Comprehension", |
38 | | - "description": "Creates a dictionary with squares of numbers.", |
39 | | - "code": "squares = {x: x*x for x in range(6)}\nprint(squares)", |
40 | | - "tags": ["dictionary", "comprehension", "python"], |
41 | | - "author": "@technoph1le", |
42 | | - "dateAdded": "2024-10-23" |
43 | | - } |
44 | | - ] |
45 | | - } |
46 | | - ] |
47 | | -} |
| 1 | +[ |
| 2 | + { |
| 3 | + "categoryName": "File Handling", |
| 4 | + "snippets": [ |
| 5 | + { |
| 6 | + "title": "Read a File", |
| 7 | + "description": "Reads the entire content of a file.", |
| 8 | + "code": "with open('file.txt', 'r') as file:\n content = file.read()\n print(content)", |
| 9 | + "tags": ["file", "read", "python"], |
| 10 | + "author": "@technoph1le" |
| 11 | + }, |
| 12 | + { |
| 13 | + "title": "Write to a File", |
| 14 | + "description": "Writes a string to a file.", |
| 15 | + "code": "with open('file.txt', 'w') as file:\n file.write('Hello, World!')", |
| 16 | + "tags": ["file", "write", "python"], |
| 17 | + "author": "@technoph1le" |
| 18 | + } |
| 19 | + ] |
| 20 | + }, |
| 21 | + { |
| 22 | + "categoryName": "Data Structures", |
| 23 | + "snippets": [ |
| 24 | + { |
| 25 | + "title": "Reverse a List", |
| 26 | + "description": "Reverses a list using slicing.", |
| 27 | + "code": "my_list = [1, 2, 3, 4, 5]\nreversed_list = my_list[::-1]\nprint(reversed_list)", |
| 28 | + "tags": ["list", "reverse", "python"], |
| 29 | + "author": "@technoph1le" |
| 30 | + }, |
| 31 | + { |
| 32 | + "title": "Dictionary Comprehension", |
| 33 | + "description": "Creates a dictionary with squares of numbers.", |
| 34 | + "code": "squares = {x: x*x for x in range(6)}\nprint(squares)", |
| 35 | + "tags": ["dictionary", "comprehension", "python"], |
| 36 | + "author": "@technoph1le" |
| 37 | + } |
| 38 | + ] |
| 39 | + } |
| 40 | +] |
0 commit comments