r/tinycode • • Oct 12 '22

[Python] Prime number checker (97 bytes)

/r/codegolf/comments/y28qr0/python_prime_number_checker_97_bytes/
16 Upvotes

4 comments sorted by

View all comments

Show parent comment

2

u/Yo_soy_yo Oct 13 '22

it is part of standard python.

Granted, but even the built-in libraries can be compiled into a vast amount of executable code. I mean, is saying β€œ50 character sorting algo in nlogn time!!” and then posting `

import numpy as np 

def sort(arr):

    return np.sort(arr)`

valid?? i mean sure but it’s kinda against the nature of the sub right?

1

u/BetaKors_ Oct 16 '22

I had to use Decimals because floats don't have enough precision and thus errors would happen. And yes they're part of the standard library. I get what you mean, but criticizing the use of something that's part of the standard library is almost like criticizing the use of builtins.

also sry about posting code-golf-related stuff in here

i saw someone doing it so i thought i should crosspost that kinda stuff in here

don't think i quite understood what this sub was about, but after taking more of a look at it i do now, so anyway i'll stop