Example Game of Object Oriented Programming in Python - Package that choose a number o letter random and you have to guess what is the correct number or letter.
- The unique requirement that you need to have is python 3 running in you device.
- This package is available via pip
https://pypi.org/project/GuessNumberLetter/
pip install GuessNumberLetter
The main objective of this project is create an example of Object Oriented Programming in python and the basic way to create a package in python. The project consists in two classes:
- Guess Number: Python random choose a number from 1 to 1000 and you have to guess what is the number, this class has the next methods.
- guess: Receive a int parameter and this method will return a text if your number is below, high or is the correct number.
- change_guess: Method that does not receive a parameter and the action is change the random number.
- get_answer: Method that does not receive a parameter, this method return the correct number.
- Guess Letter: Python random choose a letter and you have to guess what is the correct letter, this class has the next methods.
- guess: Receive a string character, for example "w" and this method will return a text if your letter is below, high or is the correct number.
- change_guess: Method that does not receive a parameter and the action is change the random letter.
- get_answer: Method that does not receive a parameter, this method return the correct letter.
Anyone could add code and improve the project. This project is handle by the GNU GENERAL PUBLIC LICENSE.