[Tutor] hELP!!!!!!!!!!!!!!!
Morne
Morne" <fromclay@maxitec.co.za
Tue, 20 Aug 2002 11:08:10 +0200
This is a multi-part message in MIME format.
------=_NextPart_000_0048_01C24839.DE8CCB60
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi Sir=20
Could you please help me with thise task Im new to Python and want to =
learn alot more,If you could help me I would very much Like that.
How would I create a Python program that takes a text file and counts =
the number of
lines in the file, the number of words in a line and then produces a
summary. The Output must look like this.
Enter file name:
> testfile.txt
LINE# WORDS
--------------------
1 20 words
2 25 words
3 30 words
4 25 words
--------------------
Summary:
4 lines, 100 words, Avg: 25 words/line
>From Morne
------=_NextPart_000_0048_01C24839.DE8CCB60
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2614.3500" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2><BR>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Hi Sir </FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Could you please help me with thise =
task Im new to=20
Python and want to learn alot more,If you could help me I would very =
much Like=20
that.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2> How would I create a Python =
program that=20
takes a text file and counts the number of<BR>lines in the file, the =
number of=20
words in a line and then produces a<BR>summary. The Output must =
look like=20
this.<BR><BR><BR>Enter file name:<BR>> =
testfile.txt<BR><BR><BR>LINE# =20
WORDS<BR>--------------------<BR>1 20=20
words<BR>2 25=20
words<BR>3 30=20
words<BR>4 25=20
words<BR>--------------------<BR>Summary:<BR>4 lines, 100 words, Avg: 25 =
words/line<BR><BR>From Morne</FONT></DIV>
<DIV> </DIV><BR><BR></FONT></DIV></BODY></HTML>
------=_NextPart_000_0048_01C24839.DE8CCB60--