Correct swaack.

This commit is contained in:
Simon Forman
2021-04-09 17:46:45 -07:00
parent e417842923
commit 7957136ac3
+5
View File
@@ -324,7 +324,12 @@ def swaack(stack):
([...1] -- [...0]) ([...1] -- [...0])
""" """
try:
(s1, s0) = stack (s1, s0) = stack
except ValueError:
raise StackUnderflowError('Not enough values on stack.')
if not isinstance(s1, tuple):
raise NotAListError('Not a list.')
return (s0, s1) return (s0, s1)