Learn practical skills, build real-world projects, and advance your career
Created 4 years ago
def my_func():
print("This is my first function")
print("Hello world")
my_func()
This is my first function
Hello world
def list_even(no_list):
res_list = []
for no in no_list:
if no%2 ==0:
res_list.append(no)
return res_list
ans_list = list_even([1,2,3,4,5,6,7,8,9,10])
ans_list
[2, 4, 6, 8, 10]