My issue
Debug this code - Why is this code incorrect
Now try and debug this problem.
You are given a program in the IDE which is trying to do the following
Accepts the count of test cases -
š”
t - in the 1st line
Each line of test case consists of an integer
š
N
For each test case, it is supposed to print double the integer
š
N as the output
Sample 1:
Input
Output
3
1
2
3
2
4
6
My code
# Debug the code below to solve the problem
t = int(input())
for i in range(t):
N = int(input())
print(N * 2)
Learning course: Design and Analysis of Algorithms
Problem Link: Debug this code - Why is this code incorrect in Design and Analysis of Algorithms