+ 1

Wap to print a neon number using while loop in python?

like if( 9**2)=81 then, 8+1=9 which is equal to initially taken no. 9

28th Oct 2018, 12:48 PM
Arpita
Arpita - avatar
3 Respuestas
0
n = int(input()) s = n**2 sum=0 while s: sum=sum+(s%10) s=s//10 if sum==n: print(n,"is a neon number") else: print(n,"is not a neon number")
28th Oct 2018, 1:20 PM
R_3-dr
R_3-dr - avatar
0
thanks
28th Oct 2018, 3:31 PM
Arpita
0
a=int(input("enter one number here")) x=a*a num1=x%10 num2=x//10 num3=num1+num2 if num3==a: print("this is a Neon number") else: print("this is not a Neon number") you do not even need to use while loop
27th Dec 2018, 9:44 PM
Khai123
Khai123 - avatar