In a recent question (Gathering numerical data from a string input) I was wondering whether this was an acceptable answer. I thought that it would make a better question. Is this kind of representation acceptable as a constant collection? Or is it a misuse of enums? And are there any unexpected consequences from assigning the same value to the different attributes on the enum in Python?
from enum import Enum
class CreditRating(Enum):
AAA = 0.01
A = 0.1
B = 0.1
creditRate = input("Please enter credit rating:")
print(CreditRating[creditRate].value)