<html>
<head>
<style>
P
{
margin:0px;
padding:0px
}
body
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body><div style="text-align: left;">You don't know what a Ti 83 is.&nbsp; Calculator.&nbsp; The most basic programming available.&nbsp; It already has so many functions built into it that it is much easier to tell it to do things.&nbsp; You don't have to do all this integer conversion and such whatnot.&nbsp; Wow... I'm really unsure of how this thing is supposed to work.&nbsp; It seems the more I learn about Python, the more confused I become.&nbsp; It's enough to bring tears to your eyes.&nbsp; Not really but ya.<br><br>Someone else helped me with the problem of accepting numbers and words.&nbsp; I used:<br><br>if shape in["1","circle"]:<br><br>something like that.&nbsp; It works wonderfully.&nbsp; I'm not sure why, but I know that it does and that is enough.&nbsp; Someone else also said that I had to convert to int, and I did.&nbsp; That was another problem, which is now fixed.<br><br>But, as usual, it is just one problem after another.&nbsp; Now I have run into this error message: <br><br>Traceback (most recent call last):<br>&nbsp; File "C:\Documents and Settings\HP_Owner\Python0\area.py", line 23, in &lt;module&gt;<br>&nbsp;&nbsp;&nbsp; area = 3.14*(radius**2)<br>TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'<br>&gt;&gt;&gt; <br><br><br>and others like this:<br><br>Traceback (most recent call last):<br>&nbsp; File "C:\Documents and Settings\HP_Owner\Python0\area.py", line 19, in &lt;module&gt;<br>&nbsp;&nbsp;&nbsp; area = height*width<br>TypeError: can't multiply sequence by non-int of type 'str'<br>&gt;&gt;&gt; <br><br><br>Very frustrating.&nbsp; What is a non-int and what is 'str'?&nbsp; Why can't it multiply the sequence?&nbsp; I guess I should include the program I'm using for these things.<br></div><br>I'm having this problem with both of these attached.&nbsp; The messages above are from area.py.&nbsp; area.py is sort of a prototype of radiacir.py, a test version.&nbsp; You know, I should probably try that int trick, which I seem to have forgotten.&nbsp; And guess what that did it.&nbsp; It's amazing when you apply the things that you learn.&nbsp; Apparently&nbsp; I am quite absent minded.&nbsp; Well It seems I don't need any of this help anymore.&nbsp; Oh well.&nbsp; Thanks anyway.<br><br>Au <br><br><br><hr id="stopSpelling">&gt; To: tutor@python.org<br>&gt; From: alan.gauld@btinternet.com<br>&gt; Date: Thu, 24 May 2007 23:34:05 +0100<br>&gt; Subject: Re: [Tutor] trouble with "if"<br>&gt; <br>&gt; "adam urbas" &lt;adamurbas@hotmail.com&gt; wrote <br>&gt; <br>&gt; &gt;  It won't even accept words.  <br>&gt; &gt; I can only get it to accept numbers.  <br>&gt; <br>&gt; try this(untested code!):<br>&gt; <br>&gt; number = None<br>&gt; data = raw_input('Type something: ')<br>&gt; try: number = int(data)<br>&gt; except: data = data.split()    # assume a string<br>&gt; <br>&gt; if number:    # user entered a number<br>&gt;     if number == 1:  print 'circle'<br>&gt;     elif number == 2: print 'another'<br>&gt; else:         # user entered words<br>&gt;     if data[0].lower() == 'circle': print 'circle'<br>&gt;     else: print 'user entered ', data[0]<br>&gt; <br>&gt; Notice that to use ithe input as a number you have to <br>&gt; convert the raw input characters to a number (using int)<br>&gt; To get the individual words we can use split() which by <br>&gt; default splits a string into the individual words.<br>&gt; <br>&gt; Is that the kind of thing you mean?<br>&gt; <br>&gt; I've no idea what a Ti83 is BTW. :-)<br>&gt; <br>&gt; Alan G.<br>&gt; <br>&gt; _______________________________________________<br>&gt; Tutor maillist  -  Tutor@python.org<br>&gt; http://mail.python.org/mailman/listinfo/tutor<br><br /><hr />Add some color. Personalize your inbox with your favorite colors. <a href='www.windowslive-hotmail.com/learnmore/personalize.html?locale=en-us&ocid=RMT_TAGLM_HMWL_reten_addcolor_0507' target='_new'>Try it!</a></body>
</html>