GoldyBot.utility.user_input.numbers

 1from __future__ import annotations
 2
 3class Numbers():
 4    """Class that holds all user input methods for dealing with numbers."""
 5    def __init__(self):
 6        pass
 7
 8    @staticmethod
 9    def get_number(number:str) -> float|int:
10        try:
11            return int(number)
12        except ValueError: # It is a bloody float!!!!
13            return float(number)
class Numbers:
 4class Numbers():
 5    """Class that holds all user input methods for dealing with numbers."""
 6    def __init__(self):
 7        pass
 8
 9    @staticmethod
10    def get_number(number:str) -> float|int:
11        try:
12            return int(number)
13        except ValueError: # It is a bloody float!!!!
14            return float(number)

Class that holds all user input methods for dealing with numbers.

Numbers()
6    def __init__(self):
7        pass
@staticmethod
def get_number(number: str) -> float | int:
 9    @staticmethod
10    def get_number(number:str) -> float|int:
11        try:
12            return int(number)
13        except ValueError: # It is a bloody float!!!!
14            return float(number)