0

fill in the blanks to open a file, read its content and print its 2nd line

file=open("filename.txt", "r") cont=file. () print(cont[]) file.close

17th Oct 2023, 1:47 AM
Jannah Mae Ynion
Jannah Mae Ynion - avatar
1 Respuesta
+ 5
file = open("filename.txt", "r") cont = file.readlines() print(cont[1]) # Index 1 corresponds to the second line (indexing starts at 0) file.close() Let me know if this helped!
17th Oct 2023, 2:06 AM
Jordan Kinney
Jordan Kinney - avatar