Consider the following Python program segment : File = open('Poem.txt', 'r')…

2023

Consider the following Python program segment : File = open('Poem.txt', 'r') T=File.readline() Identify the data type of T:

  1. A.

    String (str) / String (str)

  2. B.

    List / List

  3. C.

    Tuple / Tuple

  4. D.

    Dictionary / Dictionary

Attempted by 1253 students.

Show answer & explanation

Correct answer: A

The data type of T is string , because readline() always returns one line from the file as a string.

Explore the full course: Rssb Senior Computer Instructor