If a List L= ['Hello', 'World!'] Identify the correct output of the following…

2023

If a List L= ['Hello', 'World!'] Identify the correct output of the following Python command: print(*L)

  1. A.

    Hello World!

  2. B.

    Hello, World!

  3. C.

    'Hello', 'World!'

  4. D.

    'Hello' 'World!'

Attempted by 1659 students.

Show answer & explanation

Correct answer: A

Output: Hello World! Explanation: The * operator unpacks the list elements and print() prints them separated by a space by default. Step 1: *L expands the list into separate arguments: 'Hello' and 'World!'.

Explore the full course: Rssb Senior Computer Instructor