+ 4

Code coach - That's odd problem

I need your help: what is the type of data i the input? (list or iterals or something else)? --------- 9 1 2 3 4 5 6 7 8 9 ------- How many input() should i use (Python)? Thank you.

20th Dec 2019, 6:48 PM
Alexander Koval🇧🇾
Alexander Koval🇧🇾 - avatar
6 ответов
+ 8
I did it this way: First input gives the number of values that would follow. Then using a loop for number of values from first input, to get value by value. Append them to a list, or compute them direkt.
20th Dec 2019, 6:55 PM
Coding Cat
Coding Cat - avatar
+ 4
Thank you very much for these precious advices: I've got the revelation with your help. Thomas and Alexander, you're the best coaches!
20th Dec 2019, 10:03 PM
Alexander Koval🇧🇾
Alexander Koval🇧🇾 - avatar
+ 3
Yes, and maybe in the same loop the comparisation and add to a sum if true
20th Dec 2019, 6:59 PM
Coding Cat
Coding Cat - avatar
+ 3
Alexander, крепко жму вашу дружественную руку!
20th Dec 2019, 10:04 PM
Alexander Koval🇧🇾
Alexander Koval🇧🇾 - avatar
+ 2
And in SL the input is tricky. You have to input ALL values line by line. Each value in a single line (with return), and one submit after the last one.
20th Dec 2019, 7:06 PM
Coding Cat
Coding Cat - avatar
14th Mar 2020, 8:04 PM
高于鈞
高于鈞 - avatar