Created
March 23, 2017 16:38
-
-
Save niloy-barua/7c4b5c71914fb878dcc5e5763d232b56 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def toEvenOdd(numList): | |
""" | |
list: list containing number | |
return: two lists. first containing even numbers, second containing odd | |
numbers | |
""" | |
evenList=[] #will contain the even numbers after next iterative part | |
oddList=[] #will contain the odd numbers after next iterative part | |
for i in numList: | |
if i%2==0: | |
evenList.append(i) | |
else: | |
oddList.append(i) | |
return evenList, oddList |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
এইটায় আমরা একটা
is_even
function ব্যবহার করছি ফিল্টার করতে, ফাংশনটা রিইউজেবল, এইটুকুই সুবিধা:আমরা
is_even
কে ফিল্টারে পাস করতে পারি। যেমন শুধু ইভেন নাম্বারগুলো পাওয়া যাবে এইভাবে: