53992/what-is-the-logic-to-check-if-a-number-is-prime-or-not-in-python
n = int (input ('ENTER NUMBER TO CHECK WETHER ITS PRIME OR NOT \n'))
for i in range (2 , n):
if n % i == 0 :
print ('_NOT_ PRIME NUMBER')
break
else :
print ('IT\'s PRIME NUMBER')
There is an efficient way to write ...READ MORE
Hi, You can use this piece of code, ...READ MORE
Hi. Good question! Well, just like what ...READ MORE
Hello, A function that returns True for an integer number (int or ...READ MORE
You can also use the random library's ...READ MORE
Syntax : list. count(value) Code: colors = ['red', 'green', ...READ MORE
Enumerate() method adds a counter to an ...READ MORE
You can simply the built-in function in ...READ MORE
a = int (input('enter number')) num = a sum ...READ MORE
def Binary_search (array , element): ...READ MORE
OR
At least 1 upper-case and 1 lower-case letter
Minimum 8 characters and Maximum 50 characters
Already have an account? Sign in.