Need help understand practice questions.

I need help understanding how the practice questions work. I was working on some of the practice questions and my input and output matched the example; but it told me I was wrong. Can someone help me understand what I did wrong?

Problem = FLOW006

You’re given an integer N. Write a program to calculate the sum of all the digits of N.

Input

The first line contains an integer T, the total number of testcases. Then follow T lines, each line contains an integer N.

Output

For each test case, calculate the sum of digits of N, and display it in a new line.

Constraints

  • 1 T 1000
  • 1 N 1000000

Example

Input 3 12345 31203 2123 Output 15 9 8

My code:

numbers = input()
n = 0
for num in numbers:
x = int(num)
n += x
print(n)

input = 12345
output = 15

You are not getting the number of testcases and your solution will work for only one testcase
Repeat the same program for T times
t=int(input())
for i in range(t):
numbers = input()
n = 0
for num in numbers:
x = int(num)
n += x
print(n)

1 Like

Thank you a lot. I guess I’m confused on how to read the questions. Is there any material to help me understand this better so I don’t make these basic mistakes?