import math
def perfect(number):
root = math.sqrt(number)
if int(root + 0.5) ** 2 == number:
return 1
else:
return 0
CustomerIds = [36, 16, 4, 10, 256, 40, 54, 81, 48, 49]
count1 = 0
print(CustomerIds)
print("Number of customers are: "+str(len(CustomerIds)) )
for unique in CustomerIds:
if perfect(unique) == 1:
count1 += 1
print("Sample Output")
print(count1)
Comments
Leave a comment