Print the first 20 narcissistic numbers

My project is to generate the first 20 armstrong numbers.I have been able to generate the numbers,but the number 370 gets repeated twice. my code is: def print_narcissistic_nums(start, end): for i in range(start, end + 1): digits = list(map(int, str(i))) total = 0 length = len(digits) for d in digits: total += d ** length if total == i: print(i) print_narcissistic_nums(0, 11000)

8/22/2019 6:22:40 AM


3 Answers

New Answer


hum 370 is very narcissistic lol a condition in which this number is having an inflated sense of its own importance, a deep need for excessive attention and admiration,  nice https://code.sololearn.com/cucvayt9jw7M/?ref=app




370 and 371 are both armstrong numbers. Nothing wrong with that