Neon Number | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Neon Number

Program to check whether the given number is a neon number?

1st Dec 2017, 7:25 AM
Mr. Prakhyath Rai
Mr. Prakhyath Rai - avatar
3 Answers
+ 6
a=int(input()) if sum(list(map(int,list(str(a)))))**2==a: print("Neon number!") else: print("Not a neon number!")
1st Dec 2017, 7:44 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
23rd Feb 2018, 11:30 AM
Abhimanyu Gupta
Abhimanyu Gupta - avatar
+ 1
#Program to check Neon Number def fun_neon(): num=int(input("Enter a Number:")) var_sq=num**2 temp=var_sq sum=0 while temp!=0: rem=temp%10 sum=sum+rem if sum==num: print('{0}is Neon Number'.format(num)) else: print('{0}is Not a Neon Number'.format(num)) fun_neon()
1st Dec 2017, 7:26 AM
Mr. Prakhyath Rai
Mr. Prakhyath Rai - avatar