Question: In python, explanations help. 3. Write a function printPositive() that takes a string representing the name of a text file as a parameter. The function
In python, explanations help.
3. Write a function printPositive() that takes a string representing the name of a text file as a parameter. The function reads the numbers found in the file and prints the values that are positive >0) to the screen, one per line. You may assume that the file specified as a parameter exists and that it contains zero or more numbers. There may be more than one number per line. The following shows what the function would return when called on several sample files found in the zip file containing the assignment template. Do not forget to close the file file://Users/bmaya/Documents/DePaul_Teaching/17-18_WQ/csc241W2017Hws/assign4 html 2/4 1/24/2018 Assignment 4-CSC 241-801 Python 3.6.2 Shell File Edit Shell Debug Options Window Help >>printPositive('nums1.txt') 12 17.99 85.3 50 >>> printPositive('nums2.txt') 10 15 18.99 3.95 >> printPositive('empty.txt') Ln: 63 Col: 4
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
