filmov
tv
TypeError str object is not callable- Solved
Показать описание
#python tutorial: In this video i have shared How to read a text file into a string variable and strip newlines from list.
In order to solve this problem , i have used read() function instead of readlines() because readlines() return list on other hand read() return string, hence we need not to remove any newline from string itself, but if it still required, we can rstrip() function to remove extra space from string.
here is exact code i used for this video.
How to read a text file into a string variable and strip newlines?
print(type(data))
print(type(data))
#read() #readlines() #pythonreadtextfile .
▶▶▶Learn More◀◀◀
.
In order to solve this problem , i have used read() function instead of readlines() because readlines() return list on other hand read() return string, hence we need not to remove any newline from string itself, but if it still required, we can rstrip() function to remove extra space from string.
here is exact code i used for this video.
How to read a text file into a string variable and strip newlines?
print(type(data))
print(type(data))
#read() #readlines() #pythonreadtextfile .
▶▶▶Learn More◀◀◀
.