0
Code Coach , input format (Python)
Hi, I have a problem, who can help me. I am trying to solve a “Code Coach” exercise called “that’s odd”. (I use Python) I don’t think it’s so hard, but I am struggling with this sentence: Input Format: The first input denotes the length of the list (N). The next N lines contain the list elements as integers. So, do I have to make a list called N? Or do I have to use the input() function? Or should I make a def()? I am lost!
4 Respuestas
+ 2
Dennis Waweru
n = int(input())
data = list(range(n))
for i in range(n):
data[i] = int(input())
+ 1
As long as you place a input() function in your code, Sololearn will be able to provide the program with input. It doesn't matter what the list name has to be.
0
Thanks Jianmin and Saboor.
I am going to try it again.
0
Thanks again, I got the code right!