No products in the cart.

How to write python programme to …

CBSE, JEE, NEET, CUET

CBSE, JEE, NEET, CUET

Question Bank, Mock Tests, Exam Papers

NCERT Solutions, Sample Papers, Notes, Videos

How to write python programme to read last 2 lines of text file
  • 1 answers

Game Must 4 years, 2 months ago

with open("file.txt","r") as f: read=f.read() splited=read.split("\n") print(splited [-2]) print(splited [-1])
http://mycbseguide.com/examin8/

Related Questions

What are called tokens
  • 2 answers
What is mean by buffering in file handling?
  • 1 answers

myCBSEguide App

myCBSEguide

Trusted by 1 Crore+ Students

Test Generator

Test Generator

Create papers online. It's FREE.

CUET Mock Tests

CUET Mock Tests

75,000+ questions to practice only on myCBSEguide app

Download myCBSEguide App