Python program to How to Use File Read Method

text = []
fp= open("Add Your File path Here/Read-Text.php") 
data = fp.read()
fp.close()
print(repr(data))
data = data.split('\n')
print(data)

 

 

 

Output:

Python beginners - ProgramPython beginners - Program

 

 

 

 

Subscribe For Daily Updates

100+ Python Pattern Examplespython pattern examples - star patterns, number patterns