- 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
29 Answers
+ 12
.
1---2---3---4
|
5---6---7 8
| | |
9 10--11 12
| |
13--14--15--16
.
+ 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
+ 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.
+ 2
print(*l)
+ 2
It would be helpful to post the complete task instruction, not just input/ output and a context where you have it from
+ 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
+ 1
Oma Falk What is this?
+ 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.
+ 1
It was unclear what you asked until someone guessed it.
Please show your code attempt so we can help you!
+ 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
0
Any idea about this?
0
it is list unpacking with *
edit:
if you need help with the task, please provide some more context
0
Lisa check the output once
0
NEZ I am not asking list without commas , check output elements and input elements once
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
0
@Lisa
Yes, we aren't mind-readers right?🙄
0
Oma Falk can you write a program with this?
0
Jayakrishna🇮🇳 that is not the solution for what i asked
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 😇
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....