Skip to content

Commit e74ea94

Browse files
committed
remove faulty code
1 parent ead241a commit e74ea94

File tree

1 file changed

+0
-92
lines changed

1 file changed

+0
-92
lines changed

public/data/python.json

Lines changed: 0 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -139,19 +139,6 @@
139139
"tags": ["python", "string", "word-count", "utility"],
140140
"author": "axorax"
141141
},
142-
{
143-
"title": "Replace Substring",
144-
"description": "Replaces all occurrences of a substring in a string with another substring.",
145-
"code": [
146-
"def replace_substring(s, old, new):",
147-
" return s.replace(old, new)",
148-
"",
149-
"# Usage:",
150-
"print(replace_substring('hello world', 'world', 'Python')) # Output: 'hello Python'"
151-
],
152-
"tags": ["python", "string", "replace", "utility"],
153-
"author": "axorax"
154-
},
155142
{
156143
"title": "Split Camel Case",
157144
"description": "Splits a camel case string into separate words.",
@@ -195,19 +182,6 @@
195182
"tags": ["python", "string", "whitespace", "remove", "utility"],
196183
"author": "axorax"
197184
},
198-
{
199-
"title": "Swap Case",
200-
"description": "Swaps the case of all characters in a string.",
201-
"code": [
202-
"def swap_case(s):",
203-
" return s.swapcase()",
204-
"",
205-
"# Usage:",
206-
"print(swap_case('Hello World')) # Output: 'hELLO wORLD'"
207-
],
208-
"tags": ["python", "string", "case", "swap", "utility"],
209-
"author": "axorax"
210-
},
211185
{
212186
"title": "Find All Substrings",
213187
"description": "Finds all substrings of a given string.",
@@ -475,25 +449,6 @@
475449
"tags": ["python", "file", "copy", "utility"],
476450
"author": "axorax"
477451
},
478-
{
479-
"title": "Rename File",
480-
"description": "Renames a file from its current name to a new name.",
481-
"code": [
482-
"import os",
483-
"",
484-
"def rename_file(old_name, new_name):",
485-
" if os.path.exists(old_name):",
486-
" os.rename(old_name, new_name)",
487-
" print(f'File renamed from {old_name} to {new_name}')",
488-
" else:",
489-
" print(f'File {old_name} does not exist.')",
490-
"",
491-
"# Usage:",
492-
"rename_file('example.txt', 'new_example.txt')"
493-
],
494-
"tags": ["python", "file", "rename", "utility"],
495-
"author": "axorax"
496-
},
497452
{
498453
"title": "List Files in Directory",
499454
"description": "Lists all files in a specified directory.",
@@ -579,22 +534,6 @@
579534
"tags": ["python", "math", "prime", "check"],
580535
"author": "dostonnabotov"
581536
},
582-
{
583-
"title": "Generate Fibonacci Sequence",
584-
"description": "Generates a Fibonacci sequence up to a given number of terms.",
585-
"code": [
586-
"def generate_fibonacci(n):",
587-
" sequence = [0, 1]",
588-
" for _ in range(2, n):",
589-
" sequence.append(sequence[-1] + sequence[-2])",
590-
" return sequence[:n]",
591-
"",
592-
"# Usage:",
593-
"print(generate_fibonacci(10)) # Output: [0, 1, 1, 2, 3, 5, 8, 13, 21, 34]"
594-
],
595-
"tags": ["python", "math", "fibonacci", "sequence"],
596-
"author": "axorax"
597-
},
598537
{
599538
"title": "Check Perfect Square",
600539
"description": "Checks if a number is a perfect square.",
@@ -626,37 +565,6 @@
626565
"tags": ["python", "math", "binary", "decimal", "conversion"],
627566
"author": "axorax"
628567
},
629-
{
630-
"title": "Generate Random Number",
631-
"description": "Generates a random number within a given range.",
632-
"code": [
633-
"import random",
634-
"",
635-
"def generate_random_number(start, end):",
636-
" return random.randint(start, end)",
637-
"",
638-
"# Usage:",
639-
"print(generate_random_number(1, 100)) # Output: A random number between 1 and 100"
640-
],
641-
"tags": ["python", "math", "random", "utility"],
642-
"author": "axorax"
643-
},
644-
{
645-
"title": "Calculate GCD (Greatest Common Divisor)",
646-
"description": "Calculates the greatest common divisor (GCD) of two numbers using Euclid's algorithm.",
647-
"code": [
648-
"def gcd(a, b):",
649-
" while b:",
650-
" a, b = b, a % b",
651-
" return a",
652-
"",
653-
"# Usage:",
654-
"print(gcd(56, 98)) # Output: 14",
655-
"print(gcd(101, 10)) # Output: 1"
656-
],
657-
"tags": ["python", "math", "gcd", "algorithm"],
658-
"author": "axorax"
659-
},
660568
{
661569
"title": "Find LCM (Least Common Multiple)",
662570
"description": "Calculates the least common multiple (LCM) of two numbers.",

0 commit comments

Comments
 (0)