python read text file into string

49

python read text file into string -

with open('data.txt', 'r') as file:
    data = file.read().replace('\n', '')

Comments

Submit
0 Comments