It definitely isn't. Using someone else's code without actively engaging in the process of developing an algorithm yourself is not a good practice. What if you encounter a specific problem in the future that doesn't already have an existing solution? You will likely face difficulties in finding a way forward. Additionally, if an interviewer asks you to solve a similar problem and you solely rely on someone else's code, it will significantly decrease your chances of getting the job.
well I admire you knowing how to use ready code snippets!
given the importance of prime numbers ity is amazing that a test for primality is not in the core language
So what have you learned from this?
The sympy (symbolic math python) module would also work, but infortunately is not included in the python modules of codewars.
#11bfo_42u
thanks for the intel . python is very powerful . i will probably forget this .
It definitely isn't. Using someone else's code without actively engaging in the process of developing an algorithm yourself is not a good practice. What if you encounter a specific problem in the future that doesn't already have an existing solution? You will likely face difficulties in finding a way forward. Additionally, if an interviewer asks you to solve a similar problem and you solely rely on someone else's code, it will significantly decrease your chances of getting the job.
Well, if we're trying to learn how to efficiently solve actual day-to-day programmer problems, this is the best solution I'd imagine.
This comment is hidden because it contains spoiler information about the solution
lol
The Python way?
Import a c-based module and let it do the heavy lifting?
wow there's a module for this
This is sort of defeating the purpose of th exerise. The goal is not to know where to find the answer, but to figure out the answer.
On the 4th row you should have:
for i in set(wlo):
Because you are trying to loop through the original input string with the cases intact.
This still doesn't fix the code but at least it's one step in the right direction
ловите читера
if someone writes module, it definitely would be fast! :DD
Loading more items...