Python Program For Counting Spaces, Tabs and New lines in a File

preview_player
Показать описание
Python Program For Counting Spaces, Tabs and New lines in a File
code:-
filename = input ("Enter the filename: ")

with open(filename) as file:
tab=0
space=0
newline=0

for char in text:
if char=='\t':
tab+=1
if char==' ':
space+=1
if char=='\n':
newline+=1

print("Tabs are present in these files are ", tab)
print("Spaces are present in these files are ", space)
print("Newlines are present in these files are ", newline)

=============================================================================
Link for Tutorial Series

Jupyter Notebook Tutorial Series:-

Python Tutorial Series:-

Python Assignments and Objective Questions:-

Tech. Videos By Parag Dhawan;-

Object-Oriented Programming in Python:-

File Handling in Python:-

=============================================================================
Feel free to connect and ask your queries:-

=============================================================================
Show your support by Subscribing to the channel:-
=============================================================================
#ParagDhawan
#PythonCrashCourse
#Python
#PythonTutorialForBeginners
#PythonForDataScience
#PythonProgramming
#PythonProgrammingLanguage
#PythonTutorial
#PythonCode
#Python3

============================================================
How to Record Your Screen and make a tutorial video or demo video: -
============================================================
Рекомендации по теме