Feb-21-2017, 02:27 PM
Today I saw a post in Facebook showing visualisation from https://panjee.com on separating odd and even numbers from a list. The code goes like this:
I write all this as a word of caution with regards to such resourses...
numbers = [12, 37, 5, 42, 8, 3] even = [] odd = [] while len(numbers) > 0: number = numbers.pop() if (number%2 == 0): even.append(number) else: odd.append(number)It's really annoying to see non pythonic code propagated by tutoring site. I went to the site just to discover their introductiory video comparing python with other languages that has more of the same (https://youtu.be/r9m__27-R6M?t=40s). I mean the
a is 5
and a is True
...I write all this as a word of caution with regards to such resourses...