Complete the function below, which takes two linked lists as…
Complete the function below, which takes two linked lists as its parameters. It must print out the values in the two lists, alternating – but it must print every other element of each. First, print the first element of list 1, then the second element of list 2, then the third element of list 1, and so on. (Thus, you will never print out half of the values.) Return from the function as soon as you realize that you cannot print out the next required value – even if the other list has many remaining elements. For example, if the lists are: list 1: 10 -> 20 -> 30 -> 40 list 2: “asdf” -> “jkl” -> “fred” -> “qwerty” -> “uiop” -> “hello” -> “world” then you should print: 10 jkl 30 qwerty I have started the function for you: def print_alternating(head1, head2):