Skip to content

Guessing Game in Python#1

Open
jucooper wants to merge 6 commits intomainfrom
guess
Open

Guessing Game in Python#1
jucooper wants to merge 6 commits intomainfrom
guess

Conversation

@jucooper
Copy link
Copy Markdown
Owner

@jucooper jucooper commented May 31, 2024

Description

  • Allows the user to play a number guessing game.

Changes

  • Creates guess.py
  • Sets the lower value to 1 and upper value to 50
  • Sets the attempts to 6
  • Uses randint to select a random number between the lower and upper values

Testing

  1. Make sure Python is installed on your system.
  2. Run this command: python3 guess.py

@jucooper jucooper changed the title Creates guess.py Guessing Game in Python Jun 3, 2024
Comment thread 2024/guess.py
# The code is a simple number guessing game where the user has to guess a number between 1 and 50.

import random
import math
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not needed.

Comment thread 2024/guess.py

print("\n\tYou have ", attempts," attempts to guess the number.\n")

count = 1
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should start at zero.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant