11-06-2014, 01:24 PM
After some fucking around with python, I've been able to make a function that checks if a number is a prime number using only 1 line of code.
I like it. Its nice. Yay for python.
Code:
def prime(number): return not any(number % i == 0 for i in range(2,int(number**0.5)+1))
I like it. Its nice. Yay for python.
You know what I say.
A slut is just a free prostitute
A slut is just a free prostitute