[Tutor] my noob prog
GREENDAY31087@aol.com
GREENDAY31087@aol.com
Thu Mar 20 05:09:11 2003
--part1_31.35d024cc.2baaed17_boundary
Content-Type: text/plain; charset="US-ASCII"
Content-Transfer-Encoding: 7bit
Hey people.
I made this little program and it's like the biggest thing I've made. I only
started learning the hello world thing last month. Is this a good start or
what?? Haha.. Well, the password is '1337' and remember to add the extension
when writing/reading a file(.txt, .py, etc.). Tell me what you think!
**********
password = "foobar"
while password != "1337":
password = raw_input("Password:")
print "Welcome in"
print "please select:"
print "1 Wayne's calculator"
print "2 create a file"
print "3 read that file"
choice=input()
if choice==1:
print 'please select:'
print '1 rectangle area'
print ' 2 circle circumference'
print ' 3 circle area'
shape=input('')
if shape==1:
height=input('please enter the height:')
width=input('please enter the width:')
area=height*width
print 'the area is', area
if shape==2:
diameter=input('please enter the diameter:')
circumference=3.14*diameter
print 'the circumference is', circumference
if shape==3:
radius=input('please enter the radius:')
area=3.14*(radius**2)
print 'the area is', area
raw_input('press enter to quit')
if choice==2:
name=raw_input('what do you want to name it?')
out_file = open(name,"w")
content=raw_input('what do you want the file to say?')
out_file.write(content)
out_file.close()
if choice==3:
what=raw_input('what is the file named?')
in_file = open(what,"r")
text = in_file.read()
in_file.close()
print text
raw_input()
**********
-WaYnE
--part1_31.35d024cc.2baaed17_boundary
Content-Type: text/html; charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable
<HTML><FONT FACE=3Darial,helvetica><FONT SIZE=3D2 FAMILY=3D"SANSSERIF" FACE=
=3D"Arial" LANG=3D"0">Hey people.<BR>
I made this little program and it's like the biggest thing I've made. I only=
started learning the hello world thing last month. Is this a good start or=20=
what?? Haha.. Well, the password is '1337' and remember to add the extension=
when writing/reading a file(.txt, .py, etc.). Tell me what you think!<BR>
**********<BR>
password =3D "foobar"<BR>
while password !=3D "1337":<BR>
password =3D raw_input("Password:")<BR>
print "Welcome in"<BR>
print "please select:"<BR>
print "1 Wayne's calculator"<BR>
print "2 create a file"<BR>
print "3 read that file"<BR>
choice=3Dinput()<BR>
if choice=3D=3D1:<BR>
print 'please select:'<BR>
print '1 rectangle area'<BR>
print ' 2 circle circumference'<BR>
print ' 3 circle area'<BR>
shape=3Dinput('=0B')<BR>
if shape=3D=3D1:<BR>
height=3Dinput('please enter the height:')<BR>
width=3Dinput('please enter the width:')<BR>
area=3Dheight*width<BR>
print 'the area is', area<BR>
if shape=3D=3D2:<BR>
diameter=3Dinput('please enter the diameter:')<BR>
circumference=3D3.14*diameter<BR>
print 'the circumference is', circumference<BR>
if shape=3D=3D3:<BR>
radius=3Dinput('please enter the=20=
radius:')<BR>
area=3D3.14*(radius**2)<BR>
print 'the area is', area<BR>
raw_input('press enter to quit')<BR>
if choice=3D=3D2:<BR>
name=3Draw_input('what do you want to name it?')<BR>
out_file =3D open(name,"w")<BR>
content=3Draw_input('what do you want the file to say?')<=
BR>
out_file.write(content)<BR>
out_file.close()<BR>
if choice=3D=3D3:<BR>
what=3Draw_input('what is the file named?')<BR>
in_file =3D open(what,"r")<BR>
text =3D in_file.read()<BR>
in_file.close()<BR>
print text<BR>
raw_input()<BR>
**********<BR>
<BR>
-WaYnE</FONT></HTML>
--part1_31.35d024cc.2baaed17_boundary--