So I wrote this code and it works, however, I'm trying to find a way to make this code return the right output, as shown down below. Here is my code.
upto = 5
def original_num(upto:int):
for x in range(1, upto+1):
print (x, (7**x)%97)
def powerLoop(upto: int):
upto = upto
return original_num(upto)
print(powerLoop(upto))
But when I print the output, this is what I get...
1 7
2 49
3 52
4 73
5 26
None
But if I use print instead of return in the code,
upto = 5
def powerLoop(upto:int):
for x in range(1, upto+1):
print(x, (7**x)%97)
powerLoop(upto)
This is what I get,
1 7
2 49
3 52
4 73
5 26
How can I use return and then once I say print(powerloop(upto)
the output will occur without printing 'none'?