Computer Science, asked by sujithsunu19, 10 months ago

The even_numbers function returns a space-separated string of all positive numbers that are divisible by 2, up to and including the maximum that's passed into the function. For example, even_numbers(6) returns “2 4 6”. Fill in the blank to make this work.

Answers

Answered by pavithranatarajan855
0

Answer:

a=[]

def even_numbers(n):

 for i in range(n+1):

   if(i%2==0):

     print(i,end=" ")

     a.append(i)

print("enter n")

n=int(input())

even_numbers(n)

print("\n")

print("max=",max(a))

           

Explanation:

I hope it is useful

Similar questions