I'm trying to condense some of my code to make it more maintainable and to learn a few new tricks.Below is a Python 2.7 / Django 1.6 function which is designed to assign users to one of three surveys in my application. I require a total of 30 responses in total, 10 each. Each user is to be assigned at random to one of the three surveys to complete, once a survey e.g. SurveyTwo has had 10 participants it is taken out of the selection pool.The function returns a segment of the URL which is then used to update a button<a class=btn btn-success href=/bias_experiment{{survey_url}}>START</a>My below code works fine, but in reality I have nine such paths and I am looking to improve on my implementation method. Also, please suggest any tips on styling or techniques.PathMax = 10 TotalMax = 30TotalMaxCounter = 0SurveyWizardOneCounter = 0SurveyWizardTwoCounter = 0 SurveyWizardThreeCounter = 0 SurveyWizardFourCounter = 0 SURVEY_URLS = ['/surveyone/', '/surveytwo/', '/surveythree/']def start(request):        global TotalMaxCounter        if TotalMaxCounter < TotalMax:            survey_url = random.choice(SURVEY_URLS)        if survey_url == '/surveyone/':                print 'SurveyWizardOneCounter is: %s TotalMaxCounter is: %s' % (SurveyWizardOneCounter, TotalMaxCounter)                if SurveyWizardOneCounter > PathMax:                SURVEY_URLS.pop(0)        elif survey_url == '/surveytwo/':            print 'SurveyWizardTwoCounter is: %s TotalMaxCounter is: %s' % (SurveyWizardTwoCounter, TotalMaxCounter)            if SurveyWizardTwoCounter > PathMax:                SURVEY_URLS.pop(1)        elif survey_url == '/surveythree/':            print 'SurveyWizardThreeCounter is: %s TotalMaxCounter is: %s' % (SurveyWizardThreeCounter, TotalMaxCounter)            if SurveyWizardThreeCounter > PathMax:                SURVEY_URLS.pop(2)        return render(request, 'start.html', {'survey_url': survey_url})        else:        return render(request, 'surveyfull.html')
URL selection function that is designed to randomly assign users to different surveys until full
python;python 2.7;django