aguea asia
Python Oneliners
@pythonlines
Learning Python is fun. Sharing what you learn is important.
Joined October 2015
Tweets
4
Following
3
Followers
5
Likes
0
Photos and videos
Photos and videos
Tweets
Python Oneliners
@pythonlines
3 Nov 2015
zip(*listOfLists) # transpose a matrix
#zip
#awesome
#python
Python Oneliners
@pythonlines
3 Nov 2015
[n for n in range(10000,50000) if len(set(list(str(n)) list(str(2*n))))==10]
#all
5 digit ints n where every digit appears once in n or 2*n
Python Oneliners
@pythonlines
28 Oct 2015
zip(*[iter(someList)]*2) # returns a list of tuples containing neighboured elements of someList
Python Oneliners
@pythonlines
26 Oct 2015
all(number%i is not 0 for i in range(2,int(number**(1/2)))) # check if number is a prime number
Load more