Solve problem "Neighbors of the same sign" online - Learn Python 3 - Snakify

Problem «Neighbors of the same sign» (Easy)


Statement

Given a list of numbers, find and print the first adjacent elemets which have the same sign. If there is no such pair, leave the output blank.

In all the problems input the data using input() and print the result using print().



Saved solutions

Tests

Input Correct answer Result
-1 2 3 -1 -2
2 3
1 -3 4 -2 1
1 2 -3 -4 -5
1 2
1 -2 3 -4 -5
-4 -5
1 -2 3 -4 5 6
5 6
-1 2 -3 4 -5 6
1 -2 3 -4 5 -6
1 -2 3 -4
-1 2 -3 4
1 2 3 4
1 2
-1 -2 -3 -4
-1 -2
1 -1 1 -1 -1 1 -1 1 -1 1
-1 -1
1 -1 1 -1 1 1 -1 1 -1 1
1 1
1 -1 1 -1 1
-1 1 -1 1 -1