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:
- A.
String (str) / String (str)
- B.
List / List
- C.
Tuple / Tuple
- 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.