A tech number has even number of digits if the number is split in two equal halves then the square of sum of these halves is equal to the number itself write a program to generate and print all four digits tech numbers
Answers
Answered by
15
Answer:
It is absolutely correct check it out
Attachments:
Answered by
1
Given:
A tech number has even number of digits if the number is split in two equal halves then the square of sum of these halves is equal to the number itself
To find:
Write a program to generate and print all four digits tech numbers
SOLUTION:
for i in range(1000,10000):
s=str(i)
d=len(s)
if(d%2==0):
a1=pow((int(s[:d/2])),2)
a2= pow((int(s[d/2:])),2)
if (a1+a2)==i:
print(i)
else:
pass
Similar questions
Science,
6 months ago
Biology,
6 months ago
Science,
6 months ago
Math,
1 year ago
Psychology,
1 year ago