Jan-23-2024, 03:05 PM
(This post was last modified: Jan-23-2024, 04:13 PM by deanhystad.)
a=int(input("enter a number:")) def check_prime_numbers(): for i in range(2, (a//2+1)): if a%i==0 : print(f"{a} isn't prime number") break else: print(f"{a} is a prime number") check_prime_numbers()my teach send me this code and asked me why did he printed a instead of i
can I get some help?
deanhystad write Jan-23-2024, 04:13 PM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.