0% found this document useful (0 votes)
25 views3 pages

Python Lab 14

Uploaded by

20eumc015
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views3 pages

Python Lab 14

Uploaded by

20eumc015
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

SRL

SR KRTSHNA CoLLFGE oF ENG INE FRING AND TEcHNDLOG

NauneA Dhonush Vandhan Sub Pthon lab


Class
TMech A Bath
R No 20EUMC oad
Exp
Date

Afm
and dotonire Hhe
waite 9cqnam o a d , wite

charatehs in he ile.

C Ahanush Ert")
f epen
.

buo. Eart,w')
feut: epan C" dhanush
tenb f. Tead0)

Print Cbet)
fout uwtte (bent

f cloc )
feut dose ()

Cl 0

CW0

cC0

(°Akanush. bnt,
"1")
f open

for
ie inf
lîne Split
)
Weds

Cwt len Cwerols)


Cc+len(lfne)

incs, cD
Prnt C No of
" No o Wonds CW)
Print

Prune C"No of chaact erb , ce)


f. close ))

0ubrub

he PeDgam
i otoved and Ve pied
kk.py- C:/Users/dhanush/AppData/Local/Programs/Python/Python39/kk.py (3.9.4) IDLE Shell 3.9.4 X
File Edit Format Run Options Window Help File Edit Shell Debug Options Window Help
Python on3.9.4 (tags/v3. 9. 4:1f2e308, Apr 6 2021, 13 : 40:21) [MSC v.1928 64 bit (AM
f-open ("dhanush.txt") D64) ] win32
fout=open ("dhanushtw0.txt", 'w') Type "help", "copyright", "credits" or "license ()
"
for more information.
text=f.read () >>>
print (text) =RESTART: C:/Users/dhanush/AppData/ILocal/Programs/Python/Python39/kk.py =====

fout.write (text) I am dhanush


f.close ()
fout.close ()
No of lines: 1
No of words: 3
No of characters: 13

cl=0
CW=0
CC
f=open ("dhanush.txt", "r")
line in f:
for
words=line.split ()
Cl t=1
Cw t=len (words)
cc+=len (line)

print ( "No of lines: ',cl)


print ('No of words:',CW)
print (°No of characters: ' , CC)
f.close ()

You might also like