Skip to content

Commit

Permalink
Merge pull request #8 from Archit669/main
Browse files Browse the repository at this point in the history
add code
  • Loading branch information
thoughtlessnerd authored Feb 1, 2024
2 parents 5cd3dbb + d24df42 commit 30164f8
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
27 changes: 27 additions & 0 deletions archit/guess_number_fixed.py
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}")
18 changes: 18 additions & 0 deletions archit/pyproject.toml
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']

0 comments on commit 30164f8

Please sign in to comment.