"Check if a number is prime" Exercise Not Recognizing Correct Answer #29

Closed
opened 2025-12-17 04:05:50 +01:00 by BusterOfTheBeans · 1 comment

I've submitted the following code:

image

I have tested this code in visual studio to verify it works when called. Genepy says "I tried is_prime(1) and it returned None." It's expecting a boolean True or False. When I call is_prime(1) with the same code in visual studio it says False, not None.

I've submitted the following code: ![image](/attachments/77d9b772-0a9d-42bc-bf59-e7e41c8755cb) I have tested this code in visual studio to verify it works when called. Genepy says "I tried is_prime(1) and it returned None." It's expecting a boolean True or False. When I call is_prime(1) with the same code in visual studio it says False, not None.
Contributor

@BusterOfTheBeans Your function prints some result, but does not return anything (well, technically, it returns None). Update your function to return the result.

@mdk That may be a new case for the checker to generate a proper help message? "Maybe you forgot to return a value from your function?"

@BusterOfTheBeans Your function prints some result, but does not return anything (well, technically, it returns `None`). Update your function to return the result. @mdk That may be a new case for the checker to generate a proper help message? "Maybe you forgot to return a value from your function?"
mdk closed this issue 2025-12-18 09:06:11 +01:00
mdk referenced this issue from a commit 2025-12-18 09:06:12 +01:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
mdk/genepy-exercises#29
No description provided.