+ 1

Eratostanes

So. most of the challenges revolve around prime numbers, and I read that interviewers frequently ask how you would list prime numbers in a code, so I looked it up and found this little code based off the sieve of Eratostanes. The code works and I added in user input and changed some vars, but what is the "return>1" at the end actually do? https://code.sololearn.com/Wy0DdPspMnJM/?ref=app

26th Sep 2018, 4:37 PM
DazVonHelmet
DazVonHelmet - avatar
1 Réponse
+ 1
It returns true if n is > 1, otherwise it returns false
26th Sep 2018, 5:05 PM
Anna
Anna - avatar