This forum is now read-only. Please use our new forums! Go to forums
12/15. What is wrong?Please help ASAP.
def purify(lst): even=[] for num in lst: if num%2==0 : even.append(num) return even
Answer 5361394b7c82ca027d0000a3
5 votes
Hello again Natasha. Your code looks perfect to me. Maybe you got your indentation wrong. Your code with correct indentation —-
def purify(lst):
even=[]
for num in lst:
if num%2==0 :
even.append(num)
return even
Answer 5379ed89631fe9d1be00639b
0 votes
My code output is correct in python IDE but code editor doesn’t let me go ahead.
def purify(lst): for odd in lst: if odd % 2 == 1: lst.remove(odd)
return lst
3 comments
Siddharth Mishra almost 10 years
First Select your whole code , then go for code sample option and Remember - Always keep some empty space between the code you are selecting.
B Liyanage Asanka almost 10 years
oh Thank you bro.I get it.
Siddharth Mishra almost 10 years
you’re welcome
Popular free courses
- Free Course
Learn SQL
In this SQL course, you'll learn how to manage large datasets and analyze real data using the standard data management language.Beginner friendly,4 LessonsLanguage Fluency - Free Course
Learn JavaScript
Learn how to use JavaScript — a powerful and flexible programming language for adding website interactivity.Beginner friendly,11 LessonsLanguage Fluency - Free Course
Learn HTML
Start at the beginning by learning HTML basics — an important foundation for building and editing web pages.Beginner friendly,6 LessonsLanguage Fluency
4 comments
thanks a lot!
You’re welcome
just wondering why you instead of even.append(num) you can’t have even +=num. Thank you!
Hey mishra how do you put indent in your comment