Question: *PYTHON PROGRAM* Replace the code in the function that creates the Python list so that the numbers inserted into the list come from a text

*PYTHON PROGRAM* Replace the code in the function that creates the Python list so that the numbers inserted into the list come from a text file instead of being entered as input from the user.

def function(): li=[] while(True): n=int(input("Enter num ")) if n>0: li.append(n) else: break #sort to obtain nth largest numeber if len(li)>1: li.sort() while(True): n=int(input("enter nth largest number ")) if n>0 and n 

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!