This Python script prompts the user to input three numbers, and then determines and prints the largest number among the three.
- Accepts three floating-point numbers as input from the user.
- Compares the three numbers and determines the largest number.
- Handles cases where two or all three numbers are equal.
- Prints the largest number and any relevant information about equal numbers.
-
Clone the repository or download the
Comparing Three Numbers and Finding the Largest.pyfile. -
Open a Python environment (e.g., terminal, Jupyter Notebook).
-
Run the script by executing the following command:
python compare_numbers.py -
When prompted, enter three numbers (e.g.,
5.2,7.8,3.4). -
The script will output the largest number and any relevant information about equal numbers.
Please input your first number: 5.2
Please input your second number: 7.8
Please input your third number: 3.4
The biggest number is 7.8
Please input your first number: 10.0
Please input your second number: 10.0
Please input your third number: 10.0
Your first, second and third number are the same number.
The biggest number is 10.0
Please input your first number: 8.5
Please input your second number: 8.5
Please input your third number: 6.2
Your first number is equal to your second number.
The biggest number is 8.5
If you find any issues or have suggestions for improvements, feel free to open an issue or submit a pull request.