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!

4th Jan 2020, 7:30 PM
Danny Mientjes
Danny Mientjes  - avatar
4 Respostas
+ 2
Dennis Waweru n = int(input()) data = list(range(n)) for i in range(n): data[i] = int(input())
4th Jan 2020, 7:39 PM
Abdol Hashimi
Abdol Hashimi - avatar
+ 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.
4th Jan 2020, 7:34 PM
Jianmin Chen
Jianmin Chen - avatar
0
Thanks Jianmin and Saboor. I am going to try it again.
4th Jan 2020, 7:43 PM
Danny Mientjes
Danny Mientjes  - avatar
0
Thanks again, I got the code right!
4th Jan 2020, 8:21 PM
Danny Mientjes
Danny Mientjes  - avatar