Question: basic python why can i not print rest in the same way i can print first line? what do i need to do to make

basic python

why can i not print rest in the same way i can print first line?

what do i need to do to make it print rest?

 basic python why can i not print rest in the same

In [1]: def open_function (b): f-open (b, 'r') for i in range (1): first-line-f.readline() #### ???? is this not right??? eturn first_line rest-f.readlines() return rest f.close bbb- Notepad File Edit Format View Help testbline 1 line 2 line 3 In [2]: open function ('bbb.txt') first_line-open_function ("bbb.txt') print(first_line) print (rest) this is the file test b line 1 Traceback (most rece NameError ipython-input-2-9da573f01c2b> i want to print rest in () 2 first_line- open_function ("bbb.txt') 3 print(first_line) 4 print(rest) also how can i ensure rest does not include the first line) NameError: name 'rest is not defined

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!