4 ms·
For printing the first 10 prime numbers, there's a one line solution to this problem: print("1, 2, 3, 5, 7, 11... and so on!
by kilolima 3y ago
For printing the first 10 prime numbers, there's a one line solution to this problem:
print("1, 2, 3, 5, 7, 11... and so on!
- kordlessagain 3y agoThat code shows me a parse error.
- tuukkah 3y agoThat can't be, because primes are numbers greater than 1.
- timjver 3y agoThey said nothing about not printing any non-primes.
- tuukkah 3y agoI suppose it's indeed possible to read the assignment as "print whatever you like as long as it includes 10 or more primes" but I'd fail you for that based on not being able to communicate with humans.
- imglorp 3y agoThis is a good point; English alone is an awful specification language. Everyone knows what you mean by "print the first ten prime numbers" but only by idiom and cultural context. This is why LLM is a good fit here, because -- when it works -- it includes all three aspects.