52678/what-the-python-logic-check-if-number-armstrong-number-or-not
number = int(input("enter a number")) s = 0 temp = number while temp > 0: c = temp % 10 s += c**3 temp //= 10 if temp == num: print('armstron number') else: print('not an armstrong number')
a = int (input('enter number')) num = a sum = 0 while a!= 0 : x = a%10 sum = sum + (x*x*x) a = a//10 if sum == num: print ('YES IT\'s an AMSTRONG NUMBER') else : print('IT\'s NOT AN AMSTRONG NUMBER')
Hi, You can use this piece of code, ...READ MORE
There is an efficient way to write ...READ MORE
To print the message that file is not ...READ MORE
Hi. Good question! Well, just like what ...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
n = int (input ('ENTER NUMBER TO ...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.