Code written correctly but it is showing error while I am going to submit

Print Even Numbers up to n

def print_even(n):
for i in range(0,n):
if i%2==0:

Program is correct but after clicking on submit it shows " You have not defined function" Why? Please explain and suggest me if there is any error.

1 Like

Did you run it using SHIFT+ENTER?

I have tried everything but it still showing error, while the code is correct!