Skip to content

Commit 5c197cb

Browse files
Merge pull request #2476 from avinashkranjan/deepsource-transform-2204fcc5
format code with autopep8
2 parents de51877 + c246706 commit 5c197cb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Coding Language Learning Game/coding_language_learning_game.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@
1818
"hard": ["num1 = 10\nnum2 = 5\nprint(num1 * num2)", "def fibonacci(n):\n if n <= 0:\n return 'Invalid input'\n elif n == 1:\n return 0\n elif n == 2:\n return 1\n else:\n return fibonacci(n-1) + fibonacci(n-2)\nprint(fibonacci(6))"]
1919
}
2020

21+
2122
def get_random_code_snippet(difficulty):
2223
"""Return a random Python code snippet based on the selected difficulty."""
2324
return random.choice(difficulty_levels[difficulty])
2425

26+
2527
def main():
2628
print("Welcome to the Coding Language Learning Game!")
2729
difficulty = input("Select difficulty (easy, medium, hard): ").lower()
@@ -65,5 +67,6 @@ def main():
6567

6668
print(f"Your final score: {score}")
6769

70+
6871
if __name__ == "__main__":
6972
main()

0 commit comments

Comments
 (0)