Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Cjupyter Untitled27 Last Checkpoint: 2 hours ago (unsaved chang- aaa Notepad File Edit Format View Help est a line 1 line 2 line 3 File
Cjupyter Untitled27 Last Checkpoint: 2 hours ago (unsaved chang- aaa Notepad File Edit Format View Help est a line 1 line 2 line 3 File Edit View nsert Cell Kenel Widgets Help a rest In [11: def open function (P): open (P, 'r') first_line-f.readline() rest = f.readlines() return first line, rest f.close In [3]: first_line, rest-open_function('bbb.txt') rest-b rest first_line, rest-open_function( 'aaa.txt') rest-a rest print (a_rest) print (b rest) bbb - Notepad File Edit Format View Help NameError ipython-input-3-8e6377ebaa79 line 2 line 3 in module() 1 first_line, rest-open_function ("bbb.txt') b rest line 4 - 2 rest-b_rest 4 first_line, rest-open_function('aaa.txt) 5 rest-a rest NameError: name 'b_rest' is not defined O Type here to search i would like to print a rest and b rest at will by just typing print(a _rest) how can i do this
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered 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