Q:

Remove a value from a list using a variable

Using the following code
askNumber1 = int(str(raw_input('What range of numbers do you want? Name the minimum number here.')))
askNumber2 = int(str(raw_input('Name the max number you want here.')))
number3 = askNumber2 + 1
number_list = range(askNumber1, number3)    

number4 = str(int(random.randint(askNumber1, askNumber2)))
number_list.remove(number4)
print number_list
print 'Is this your number: ' + number4 + '?'

gives me the error:

ValueError: list.remove(x): x not in list

Is this any way to remove an integer from number_list using a variable defined as a random number between two other variables? Or is there a simpler way to do this?

A:

number4 is a string, while your list consists of integers, so even if your list is [0,1,2,3], doing number_list.remove("2") will result in the error since 2!="2"

