Python code
main() File "final.py", line 110, in main task2() File "final.py", line 65, in task2 assert n >= 2, "Must enter two or more characters!" AssertionError AssertionError: Must enter two or more characters! "/>
Extracted text: Task2: Swap Adjacent List Elements Input two or more chars separated by spaces: a b a ba ba b Initial list ['a', 'b', 'a', 'b', 'a', 'b', 'a', 'b'] String version: 'abababab' Modified list Example of case 1 (even # of items) ['b', 'a', 'b', 'a', 'b', 'a', 'b', 'a']* String version: 'babababa' --- Task2: Swap Adjacent List Elements ---- -- Input two or more chars separated by spaces: t hi sis atest Initial list ['t', 'h', 'i', 's', 'i', 's', 'a', 't', 'e', 's', 't'] String version: 'thisisatest' Modified list Example of case 2 (odd # of items) ['h', 't', 's', 'i', 's', 'i', 't', 'a', 's', 'e', 't'] String version: 'htsisitaset' Task2: Swap Adjacent List Elements Input two or more chars separated by spaces: 1 2 3 4 5 --- --- Initial list ['1', '2', '3', '4', '5'] String version: '12345' Modified list ['2', '1', '4', '3', '5'] String version: '21435' Task2: Swap Adjacent List Elements Example of that causes an Input two or more chars separated by spaces: 1 Traceback (most recent call last): File "file.py", line 119, in
main() File "final.py", line 110, in main task2() File "final.py", line 65, in task2 assert n >= 2, "Must enter two or more characters!" AssertionError AssertionError: Must enter two or more characters!