Is it possible to use raw_input with a variable?
For example.
max = 100
value = raw_input('Please enter a value between 10 and' max 'for percentage')
Thanks,
Favolas
You can pass anything that evaluates to a string as a parameter:
value = raw_input('Please enter a value between 10 and' + str(max) + 'for percentage')
use + to concatenate string objects. You also need to explicitely turn non-strings into string to concatenate them using the str() function.
one more way to do it :)
value = raw_input('Please enter a value between 10 and %i for percentage' % (max))
raw_inputfunction and everything to do with getting a variable to appear as part of a string.