l = [1,2,3,4,5,6,7,9,10,11,12,13,14,15,16] 1 2 3 4 8 12 16 15 14 13 9 5 6 7 11 10 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

l = [1,2,3,4,5,6,7,9,10,11,12,13,14,15,16] 1 2 3 4 8 12 16 15 14 13 9 5 6 7 11 10

Input = [1,2,3,4,5,6,7,9,10,11,12,13,14,15,16] output = 1 2 3 4 8 12 16 15 14 13 9 5 6 7 11 10

3rd Feb 2022, 11:10 AM
Manoj Bhaagam
29 Answers
+ 12
.    1---2---3---4                 |    5---6---7    8    |        |    |   9  10--11  12    |            |   13--14--15--16 .   
3rd Feb 2022, 3:34 PM
Oma Falk
Oma Falk - avatar
+ 4
Spiral iteration. Manoj Bhaagam Are you sure there is no error in your input? where did the 8 go? There is no 8 in your input and it is there in your output. It is just wrong. Be extra careful with typing. It will give you trouble later on if it becomes a bad habit. https://code.sololearn.com/cqkMHLl9lmY6/?ref=app
4th Feb 2022, 2:24 AM
Bob_Li
Bob_Li - avatar
+ 3
3 times + 1 3 times + 4 3 times - 1 2 times - 4 2 times +1 1 time +4 1 time -1 Now.... I drove you almost all the way. The last steps u go on your own feet and code it.
3rd Feb 2022, 4:27 PM
Oma Falk
Oma Falk - avatar
+ 2
print(*l)
3rd Feb 2022, 1:37 PM
Oma Falk
Oma Falk - avatar
+ 2
It would be helpful to post the complete task instruction, not just input/ output and a context where you have it from
3rd Feb 2022, 3:07 PM
Lisa
Lisa - avatar
+ 2
This is the way we have to print the numbers I'm I right Oma Falk 1 2 3 4 8 12 16 15 14 13 9 5 6 7 11 10    1---2---3---4                 |    5---6---7     8    |        |    |   9   10--11   12    |             |   13--14--15---16 Bob_Li your answer is awesome https://code.sololearn.com/cqkMHLl9lmY6/?ref=app
5th Feb 2022, 3:21 AM
RISHIRAM K
RISHIRAM K - avatar
+ 1
Oma Falk What is this?
3rd Feb 2022, 1:40 PM
Manoj Bhaagam
+ 1
Manoj Bhaagam After reading your question 3-4 times and viewing the answer of Oma Falk I got to know that you want to output a list without commas and [], right?? As said, @Oma Falk has given your answer, to know about (*) Lisa has given you some information and for more you can surf in google.
3rd Feb 2022, 2:33 PM
NEZ
NEZ - avatar
+ 1
It was unclear what you asked until someone guessed it. Please show your code attempt so we can help you!
3rd Feb 2022, 3:59 PM
Lisa
Lisa - avatar
+ 1
This is the way we have to print the numbers am I right Oma Falk 1 2 3 4 8 12 16 15 14 13 9 5 6 7 11 10    1---2---3---4                 |    5---6---7     8    |        |    |   9   10--11   12    |             |   13--14--15---16 Bob_Li your answer is awesome https://code.sololearn.com/cqkMHLl9lmY6/?ref=app
6th Feb 2022, 4:06 PM
RISHIRAM K
RISHIRAM K - avatar
0
Any idea about this?
3rd Feb 2022, 11:42 AM
Manoj Bhaagam
0
it is list unpacking with * edit: if you need help with the task, please provide some more context
3rd Feb 2022, 2:08 PM
Lisa
Lisa - avatar
0
Lisa check the output once
3rd Feb 2022, 2:10 PM
Manoj Bhaagam
0
NEZ I am not asking list without commas , check output elements and input elements once
3rd Feb 2022, 2:38 PM
Manoj Bhaagam
0
Can you please give a elaboration about the problem, cuz I am not that 'smart' to get your question by just viewing your input and output. Hope you understand
3rd Feb 2022, 2:43 PM
NEZ
NEZ - avatar
0
@Lisa Yes, we aren't mind-readers right?🙄
3rd Feb 2022, 3:08 PM
NEZ
NEZ - avatar
0
Oma Falk can you write a program with this?
3rd Feb 2022, 3:41 PM
Manoj Bhaagam
0
Jayakrishna🇮🇳 that is not the solution for what i asked
3rd Feb 2022, 3:43 PM
Manoj Bhaagam
0
Lisa I have list of values is l = [1,2,3,4,5,6,7,9,10,11,12,13,14,15,16] I need output like this 1 2 3 4 8 12 16 15 14 13 9 5 6 7 11 10 in list also no problem. values sorting is important. Check the difference between input values and output values.use the logic to print this elements 1 2 3 4 8 12 16 15 14 13 9 5 6 7 11 10. I can't explain more than this 😇
3rd Feb 2022, 4:06 PM
Manoj Bhaagam
0
I understood, after the Oma Falk post. And i taken back already, as it was duplicate answer. Further any help from others, post the try which you tried so far. . . Manoj Bhaagam N=4, x=4 rounds, 4x4 matrix reading , I = 1, 2 , 3 , 4, +4, +4, N+4, -1, -1, -1, -N, -N, +1, +1, +N, -1 @ ex: I = 1, 2 , 3 , 4, N+4, N+4, I=N+4, -1, -1, -1, -N, -N, +1, +1, +N , -1 observed? 4 numbers, 3 adds 3 subtract 2 subtract 2 adds 1 add 1 subtract direction changing, then sign (+, -) changing... can't explain more... confused? am also but if you starts coding, then you can find your own idea... I got it that way....
3rd Feb 2022, 4:07 PM
Jayakrishna 🇮🇳