Need help... Correct variable doesn't increase after every iteration

import random
correct=0
def start(correct):
    
    for num1 in range(1,20):
        num1=random.randint(1,17)
    for num2 in range(1,20):
        num2=random.randint(1,10)
    product=num1*num2
    print("multiply", num1, " by", num2)
    answer=int(input('enter your answer '))
    incorrect=1
    
    while product!=answer:
        print("try again")
        try:
            answer=int(input('enter your answer '))
            incorrect=incorrect+1         
        except ValueError:
            print("please enter your answer")
        print('no. of incorrect attempts = ', incorrect)
        continue
    
    while product==answer:
        print('well done')
        correct+=1
        print('score = ', correct)
        break
        
        
        
while True:
    start(correct)

Hi @suryaturubilli,
Can you please write the complete function **start**

Hi @Ishvinder
That’s all…
Everything from the variables num1 , num2 to break in 2nd while block, completes the start function
Isn’t start function complete according to u??
I’m a novice… Could you help…

Because you’ve taken correct as a global variable, and when you’re passing it to the function, it is taking a copy of the variable, and not the variable itself.
When you say correct += 1 inside the scope of the function, it will increase the value for local copy, but the global variable will remain 0.
To counter this, you can return the local variable correct and change the global one with this returned value. Something like this:
SmartSelect_20200603-194429_Chrome