The code is creating a random number from a low value and a high value supplied by the user. Why, when printing the value of the comp_num inside the function it returns the correct value but when printing it at the end of the sequence it is 0.
import random
comp_num = 0
def generateNumber():
comp_num = random.randint(low_number,high_number)
print(comp_num)
low_number = int(input("Please select the minimum number"))
high_number = int(input("Please select the high number"))
generateNumber()
print(f"The comp_num is {comp_num}")