For the following Python statement: Msg = ('Good Day') What shall be the data…

2023

For the following Python statement: Msg = ('Good Day') What shall be the data type of Msg?

  1. A.

    tuple

  2. B.

    list

  3. C.

    Error in statement

  4. D.

    string

Attempted by 2604 students.

Show answer & explanation

Correct answer: D

In Python, parentheses alone do not create a tuple. When a single expression is enclosed in parentheses without a trailing comma, it is treated as a string. Therefore, ('Good Day') is interpreted as the string "Good Day".

Explore the full course: Rssb Senior Computer Instructor