Multiple choice technology programming languages

(define list1 (list 1 2 3)) (define list2 (list 4 5 6)) (define list3 (list)) (append list3 list1 list2) what will be the output if we display list3?

  1. ((1 2 3 4 5 6))

  2. (1 2 3 4 5 6)

  3. ()

  4. (4 5 6 1 2 3)

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

append returns a NEW list with combined elements - it does not modify the original lists. list3 remains empty because append was not assigned back to list3. The correct expression would be (set! list3 (append list3 list1 list2)).