My code is that can you help me


def is_prime(x): if x<2: return False else: for n in range(2,x): if x==2: return True break elif x%n==0: return False break else: return True break
my code is that can you help me

6. is_prime Troubleshooting Help

break is unreachable after return. All three instances of it can be removed from the code.

This should be before the loop.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.