Given a list of numbers, say:
[0,0,2,4]
I need to prompt the user to pick a number between the min and max values.
For example, I want to prompt the user with:
"Enter a number between 0 and 4: "
and have the user must input a number in that range. In order to do that, I need to calculate the min and the max values of the list.
So, if instead the list was [1,2,4,6,7]
, the prompt should change to:
"Enter a number between 1 and 7: "
I tried this:
input("Enter a number from {0} and {1}: ").format(min(lst),max(lst))
...however this does not work. Can anyone help?