Welcome folks today in this post we will be finding
armstrong numbers between an
interval in python. All the full source code of application is given below.
In order to get started you need to make an
app.py file and copy paste the following code
lower = int(input("enter a lower number in range: ")) upper = int(input("enter a upper number in range: ")) for num in range(lower, upper + 1): # order of number order = len(str(num)) # initialize sum sum = 0 temp = num while temp > 0: digit = temp % 10 sum += digit ** order temp //= 10 if num == sum: print(num)
Now if you execute the python
script by typing the below command