Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Import the data file Use curl to import the data set from the following link:

https://raw.githubusercontent.com/mtwood2/python1/main/us_covid_data.txt

store the file as covid.txt

Create a Function to Process the Data

create a function called process_data() that takes no parameters

Inside the function:

create a list to store the data as a list and initialize it

open the file in read only mode

The first line contains headings. Read it, but do not enter it into the list

read the data line by line while removing leading whitespace and new line characters using a loop and the .readline() function

close the file

return the list of data

Test the function by calling the function in your main code and printing the results

question from:https://stackoverflow.com/questions/65602518/how-we-can-create-this-function-in-python

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
244 views
Welcome To Ask or Share your Answers For Others

1 Answer

Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...