print('100 To 1000 The number of all daffodils before is as follows :')
for i in range(100, 1000):
# Take a hundred 371 // 100 = 3
x = i // 100
# Take the tens 371 // 10 =3 7; 37 % 10 = 7
y = i // 10 % 10
# Take a single 371 % 10 = 1
z = i % 10
# Judge the position 、 ten 、 The sum of the hundreds of digit cubes is equal to the original number
if x ** 3 + y ** 3 + z ** 3 == i:
print(f'{i} It's Narcissus ')
print('100 To 1000 The number of all daffodils before is as follows :')
number = 100
while number < 1000:
# Take a hundred 371 // 100 = 3
x = number // 100
# Take the tens 371 // 10 =3 7; 37 % 10 = 7
y = number // 10 % 10
# Take a single 371 % 10 = 1
z = number % 10
# Judge the position 、 ten 、 The sum of the hundreds of digit cubes is equal to the original number
if x ** 3 + y ** 3 + z ** 3 == number:
print(f'{number} It's Narcissus ')
# Need to set up number Add one... At a time
number += 1