TypeError: range() integer end argument expected, got str
<p>I am not understanding where did I possibly go wrong in the below code. It keeps saying range() Integer end argument expected, got str.</p>

<pre><code>def test():

    nameList = ["Default", "Customize..."]
    for name in nameList:
             activateFieldsSubMenus(2, name)


def activateFieldsSubMenus(subMenusName,tries=1):

              for i in range(tries):
                 try:
                     mouseClick(waitForObject(":NYSE Connect_DetailedQuoteFieldsPanel"), 42, 13, 4, Button.Button3)
                     menuItem = waitForObjectItem(":NYSE Connect_DetailedQuoteFieldsPanel", "Fields")
                     activateItem(menuItem)
                     subs = object.children(menuItem)
                     for item in subs:
                         if subMenusName in item.text:
                             activateItem(item)

                             break
                         snooze(1)
</code></pre>