Skip to content

Commit b20771e

Browse files
style: format code with autopep8
Format code with autopep8 This commit fixes the style issues introduced in 11382f7 according to the output from Autopep8. Details: https://app.deepsource.com/gh/avinashkranjan/Amazing-Python-Scripts/transform/7c7405d8-b3bd-4ada-ac31-b16280a458cb/
1 parent 11382f7 commit b20771e

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Guess the number/script.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
import random
22

3+
34
def guess_the_number():
45
print("Welcome to Guess the Number Game!")
56
print("I'm thinking of a number between 1 and 100.")
6-
7+
78
secret_number = random.randint(1, 100)
89
attempts = 0
9-
10+
1011
while True:
1112
try:
1213
guess = int(input("Enter your guess: "))
1314
attempts += 1
14-
15+
1516
if guess == secret_number:
16-
print(f"Congratulations! You guessed the number in {attempts} attempts.")
17+
print(
18+
f"Congratulations! You guessed the number in {attempts} attempts.")
1719
break
1820
elif guess < secret_number:
1921
print("Too low! Try again.")
@@ -22,5 +24,6 @@ def guess_the_number():
2224
except ValueError:
2325
print("Invalid input. Please enter a valid number.")
2426

27+
2528
if __name__ == "__main__":
2629
guess_the_number()

0 commit comments

Comments
 (0)