Help me in solving LPYAS151 problem

My issue

Wrong Answer: Failed on a hidden test case

My code

num = int(input("Enter a number: "))
sum = 0
temp = num
n = len(str(num))  # Number of digits

# Calculate the Armstrong number sum
while temp > 0:
    digit = temp % 10  # Extract the last digit
    sum += digit ** n  # Raise to the power of the number of digits
    temp //= 10  # Remove the last digit

# Check if the computed sum matches the original number
if num == sum:
    print("Armstrong")
else:
    print("Not Armstrong")

Learning course: Roadmap to 3*
Problem Link: https://www.codechef.com/learn/course/klu-roadmap-3star/KLURMP300B/problems/LPYAS151

num = int(input("Enter a number: "))
armstrong_sum = 0  # Changed variable name from 'sum' to 'armstrong_sum'
temp = num
n = len(str(num))  # Number of digits

# Calculate the Armstrong number sum
while temp > 0:
    digit = temp % 10  # Extract the last digit
    armstrong_sum += digit ** n  # Raise to the power of the number of digits
    temp //= 10  # Remove the last digit

# Check if the computed sum matches the original number
if num == armstrong_sum:
    print("Armstrong")
else:
    print("Not Armstrong");
issue:the variable name sum, which is a built-in function in Python