DEV Community

itsleenzy ✨
itsleenzy ✨

Posted on

I made a number-guessing game… but it lies to you.

I made a small Python project and wanted to share it here.

It’s a number-guessing game, but with a twist: the program sometimes lies about whether your guess is too high or too low. The truth vs. lie behavior is controlled using weighted randomness, so the game occasionally misleads you on purpose.

It was a fun way to practice loops, conditionals, user input, and the random.choices() function. I also added a fixed number of attempts so the game doesn’t run forever.

Repo link:
https://github.com/itsleenzy/deceptive-guessing-game/tree/main

Open to suggestions or ideas for improving it.

Top comments (1)

Collapse
 
dshaw0004 profile image
Dipankar Shaw

your code does not have any file extension. add python file extension to it. code => code.py. if you are using any unix based system then add shebang in the top of the file