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
1 Resposta
+ 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!