-3

I have this list from user input:

sun=[8,8,7,7,4,6,4,5,]
>>> sun.index(8)
0
>>> sun.index(7)
2
>>> sun.index(4)
4

Would like to write a program to print "Impossible", because 4,5,6 are not in correct order in the list.

Dimitris Fasarakis Hilliard
  • 150,925
  • 31
  • 268
  • 253

1 Answers1

2

print "Impossible" * (sun != sorted(sun))

Wera
  • 357
  • 2
  • 4