This Python program receives an integer from the user and performs two operations:
1. Calculates and displays the sum of its digits
2. Multiplies the input number by the digit sum and prints the result
# Get number from user
num = int(input("Enter a number: "))
# Calculate digit sum
digit_sum = sum(int(d) for d in str(abs(num)))
# Multiply number by digit sum
product = num * digit_sum
# Display results
print("\n--- Results ---")
print("Sum of digits:", digit_sum)
print("Product of number and digit sum:", product)
Enter a number: 123
--- Results ---
Sum of digits: 6
Product of number and digit sum: 738
- The input number is received using input() and converted to int
- The digit sum is calculated by converting the number to a string and summing its digits
- The product is computed by multiplying the original number by the digit sum
- Results are printed with clear labels for readability