Answered step by step
Verified Expert Solution
Question
1 Approved Answer
python, printing a line from a file i need to open the file with a function ive made, i think ive got that, now i
python, printing a line from a file
i need to open the file with a function ive made, i think ive got that, now i want it to print just the first line
In [1 def open_function (b) f-open(b, 'r for i in range (1): bbb - Notepad File Edit Format View Help testbline 1 line 2 line 3 first-line-f.readline() #### ???? is this not right??? rest-f.readlines() f.close In [2]: open function ("bbb.txt') print(first_line) Traceback (most recent call last) NameError python-input-2-8c6b9aaf22ad in --> 1 open-function (bbb.txt)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started