-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from Archit669/main
add code
- Loading branch information
Showing
2 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import random | ||
|
||
guesses_made = 0 | ||
name = input("Hello! What is your name?\n") | ||
|
||
number = random.randint(1, 20) | ||
print(f"Well, {name}, I am thinking of a number between 1 and 20.") | ||
|
||
while guesses_made < 6: | ||
guess = int(input("Take a guess: ")) | ||
guesses_made += 1 | ||
|
||
if guess < number: | ||
print("Your guess is too low.") | ||
|
||
if guess > number: | ||
print("Your guess is too high.") | ||
|
||
if guess == number: | ||
break | ||
|
||
if guess == number: | ||
print( | ||
f"Good job, {name}! You guessed my number in {guesses_made} guesses! But this line is way too long!" | ||
) | ||
else: | ||
print("Nope. The number I was thinking of was {number}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[tool.black] | ||
exclude = ''' | ||
/( | ||
\.eggs | ||
| \.git | ||
| \.hg | ||
| \.mypy_cache | ||
| \.tox | ||
| \.venv | ||
| _build | ||
| buck-out | ||
| build | ||
| dist | ||
)/ | ||
''' | ||
include = '\.pyi?$' | ||
line-length = 88 | ||
target-version = ['py36', 'py37', 'py38'] |