Question: Using visual studio python. How do I make the numbers from a data.txt file (numbers are in a single column, seperated into 100 lines) into

Using visual studio python. How do I make the numbers from a data.txt file (numbers are in a single column, seperated into 100 lines) into a single string seperated into a comma?

I'm doing:

from_data = open("data.txt", 'r')

string = ', '.join(from_data)

print(string)

from_data.close()

but they are not in a single line and are seperated into new lines

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!