Share your repls and programming experiences

← Back to all posts
A Prime Number Calculator
mariocat

A program that checks if a number is prime, composite, or neither.

Voters
mariocat
Comments
hotnewtop
CoderGautamYT

Great start! I suggest using only one except without an error specified. Specifying the error is only for when you need to do different things on different errors. In your case, your doing the exact same thing on both errors.

MrVoo

Nice, maybe make it repeat so you don't have to press run every time?

mariocat

@MrVoo thank you for your feedback!

MrVoo

@mariocat A l s o, you don't need to specify an error for except statements, just except: will do.

mariocat

@MrVoo ah ok, thanks for letting me know!