Question: printing from a file in python ionly want to make changes to this i wish to define in my function what the first line is

 printing from a file in python ionly want to make changes

printing from a file in python ionly want to make changes to this i wish to define in my function what the first line is and what the rest of the file is. that way i can call the function and say print(first_line) or print (rest) and it can just print it there i have made print(first_line) work. t doing the same thing for print(rest) doesnt work i want "rest" to be all of the file EXCEPT for the first line and to be able to print it in the same way dot open tunctien (: f upen(b,' first line-f.reodline() return first linc rest-f.readlines( return r25 f.clcsc i can print the first line i only want to change my function In 11: def open function (b): first-line f .raad, ina() relurni finl 1ine ???? is this not right??? #### not this rest-f.realines( apen function bbb.txt test line 1 1ina 2 print( irst-line ) print(rest) test b line printifirst_1incj print(rest) Tracehack (mast recent call last) ipython-input-4-52f91cdir7> in codule0 test b line 1 print(first line) --> 4 print (rest NancError: nancrst is not delincd

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!