Your redeclaring the function printThis twice. Name thrm printA and printB. As your currently calling the second one twice.
Ian On Fri, Sep 15, 2017, 10:47 PM jettam <[email protected]> wrote: > From this function I m expecting this result: > printStack(2,3) > AAA number: 1 > AAA number: 2 > BBB number: 1 > BBB number: 2 > BBB number: 3 > > But instead I am getting this result!? Why isnt it giving me my expected > result. > printStack(2,3) > BBB number: 1 > BBB number: 2 > BBB number: 3 > BBB number: 1 > BBB number: 2 > BBB number: 3 > > def printStack(numTimes_A=None,numTimes_B=None,): > ''' print AAA x times ''' > def printThis(): > for x in range (numTimes_A): > int = (x+1) > print "AAA number: " + str(int) > > ''' print BBB x times ''' > def printThis(): > for i in range (numTimes_B): > int = (i+1) > print "BBB number: " + str(int) > > if numTimes_A >= 1: > printThis() > > if numTimes_B >= 1: > printThis() > > > printStack(2,3) > > -- > You received this message because you are subscribed to the Google Groups > "Python Programming for Autodesk Maya" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/python_inside_maya/7366c07c-104f-4a8e-b0a9-38533d86b60e%40googlegroups.com > <https://groups.google.com/d/msgid/python_inside_maya/7366c07c-104f-4a8e-b0a9-38533d86b60e%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAL6_5Q9c7%2BF_7EnFYCOhioNU4Cjn1k3oS04gZpn7M93%2B-2R4qg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
