0

I write python code in atom editor and make program arithmetic sequence in function

this is the code:

def arithmetic(n):
flag = n

for flag in range(10):
    number = []
    result =  number.append(flag**2)
    return result

the result when print(arithmetic(5)):

None
Eskapp
  • 3,419
  • 2
  • 22
  • 39

1 Answers1

1

Check this code.

def arithmetic(n):
    flag = n
    number = []
    for flag in range(10):
        number.append(flag**2)
    return number

print (arithmetic(4))
skr
  • 2,146
  • 19
  • 22