0

Why this code prints the output 2 times?

This is a Python code which receives an integer and tell u if this number is Prime or not... But this code prints "not prime" 2 times... Why???? https://code.sololearn.com/cKxpMhNbkv9t/?ref=app

16th Oct 2022, 3:33 AM
Amateur
2 RĂ©ponses
+ 4
Because there is no break so if else part may execute many times
16th Oct 2022, 4:50 AM
AÍąJ
AÍąJ - avatar
+ 1
AÍąJ Thank u
16th Oct 2022, 8:02 AM
Amateur