My issue
I am using python3 to solve the problem, I generated the number starting with ‘3’ and ending with ‘3’ and ‘0’ in between if the digit is greater than 2 digit number(n>2) but I am always getting run time error. Please help me out to figure out the flaw and correct it. The code is as followed
t = int(input())
for _ in range(t):
n = int(input())
s = “”
for i in range(n):
if i == 0 or i == n-1:
s += '3'
else:
s += '0'
print(int(s))
My code
t = int(input())
for _ in range(t):
n = int(input())
s = ""
for i in range(n):
if i == 0 or i == n-1:
s += '3'
else:
s += '0'
print(int(s))
Learning course: Jump from 2* to 3*
Problem Link: Make it Divisible Practice Problem in Jump from 2* to 3* - CodeChef