Answer the question
In order to leave comments, you need to log in
How to remove a variable from a function that is in a loop?
import math
def calculation(a_a):
for i in range(10000): # до 9999
b = str(a_a)
num = []
q = int(b[0])
w = int(b[1])
e = int(b[2])
r = int(b[3])
if math.fabs(q - r) == w + e:
num.extend(f'{q}{w}{e}{r}')
the_a = 1400
calculation(the_a)
the_a = 1600
calculation(the_a)
print(num)
Answer the question
In order to leave comments, you need to log in
return(variable name)
def adding(a, b):
# this function is return the value of(a + b)
return a + b
print(adding(2,3)) # выведет 5
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question