Re: [Tutor] trouble with if

2007-10-26 Thread Alan Gauld
"Bryan Fodness" <[EMAIL PROTECTED]> wrote >I cannot get this to work either. Brian, when you post please tell us exactly what does not work. If there is an error message send the whole error there is a lot of useful information in them. Otherwise we have to read your code and guess what might be

Re: [Tutor] trouble with if

2007-10-25 Thread Aditya Lal
I think you need to use "raw_input" instead of "input". input "eval" the input expression while "raw_input" just stores it. I find the module help very handy when I am in doubt. >>> print raw_input.__doc__ raw_input([prompt]) -> string Read a string from standard input. The trailing newline is s

Re: [Tutor] trouble with if

2007-10-25 Thread Bryan Fodness
I cannot get this to work either. woffaxis = 7 if woffaxis != 0: woaf_pos = input("What is Wedge Direction (N/A, Lateral, Towards Heal, Towards Toe)?") if woaf_pos == 'Towards Toe': woffaxis = woffaxis elif woaf_pos == 'Towards Heal': woffaxis = (woffaxis * -1) else: woffaxis

Re: [Tutor] trouble with if

2007-10-24 Thread John Fouhy
On 25/10/2007, Bryan Fodness <[EMAIL PROTECTED]> wrote: > I have the following code, it keeps giving me a value of 1 for e. > > for line in file('21Ex6MV_oaf.dat'): > oa, openoa, w15, w30, w45, w60 = line.split() > if (float(oa) == round(offaxis)) and (eff_depth < 10 and unblockedFS > > 15)

Re: [Tutor] trouble with "if"

2007-05-29 Thread Grant Hagstrom
Right above the empty reply box is a "reply to all" link. Hit it, and you're good to go. On 5/30/07, Adam Urbas <[EMAIL PROTECTED]> wrote: Dang it... I am really going to have to figure out how to reply all. The cc thing only worked once and now I'm still sending to you. On 5/30/07, Adam Urbas

Re: [Tutor] trouble with "if"

2007-05-29 Thread Adam Urbas
Dang it... I am really going to have to figure out how to reply all. The cc thing only worked once and now I'm still sending to you. On 5/30/07, Adam Urbas <[EMAIL PROTECTED]> wrote: > I started to read Alan Gauld's tutorial. The problem is, once I get > past the very basics of something, I tend

Re: [Tutor] trouble with "if"

2007-05-29 Thread Adam Urbas
ok well, I'm testing to see if the CC thing worked. On 5/29/07, Adam Urbas <[EMAIL PROTECTED]> wrote: > I'll try the CC thing. > > On 5/29/07, Adam Urbas <[EMAIL PROTECTED]> wrote: > > Well, Brian, I am now very sure that we have different versions of > > gmail, because on both the Quick Reply and

Re: [Tutor] trouble with "if"

2007-05-29 Thread Brian van den Broek
adam urbas said unto the world upon 05/29/2007 12:39 PM: > The scary part is, I think I understand this. I copied your last > example and put it in IDLE and it doesn't like you code. Never > mind. I figured it out. So that is so it will notify you if your > choice is invalid. Nice lil tidbit o

Re: [Tutor] trouble with "if"

2007-05-29 Thread adam urbas
Date: Sun, 27 May 2007 15:10:08 -0400> From: [EMAIL PROTECTED]> To: [EMAIL PROTECTED]> CC: tutor@python.org> Subject: Re: [Tutor] trouble with "if"> > adam urbas said unto the world upon 05/27/2007 01:49 PM:> > Thank you for the help Brian. I would like to ask

Re: [Tutor] trouble with "if"

2007-05-28 Thread Thorsten Kampe
* Rikard Bosnjakovic (Mon, 28 May 2007 17:55:42 +0200) > On 5/28/07, Thorsten Kampe <[EMAIL PROTECTED]> wrote: > > Do you really think someone can or will read what you wrote? I've > > never seen something so horribly formatted like you emails - and I've > > seen lots of awful formatted emails... >

Re: [Tutor] trouble with "if"

2007-05-28 Thread Rikard Bosnjakovic
On 5/28/07, Thorsten Kampe <[EMAIL PROTECTED]> wrote: > Do you really think someone can or will read what you wrote? I've > never seen something so horribly formatted like you emails - and I've > seen lots of awful formatted emails... Looks fine at my end. -- - Rikard - http://bos.hack.org/cv/

Re: [Tutor] trouble with "if"

2007-05-28 Thread Kent Johnson
adam urbas wrote: > Very frustrating. What is a non-int and what is 'str'? Why can't it > multiply the sequence? I guess I should include the program I'm using > for these things. These are more examples of the same kinds of errors you have been having. Values in Python have a type. Some ex

Re: [Tutor] trouble with "if"

2007-05-28 Thread Thorsten Kampe
rototype of radiacir.py, a test version. You know, I should probably try that int trick, which I seem to have forgotten. And guess what that did it. It's amazing when you apply the things that you learn. Apparently I am quite absent minded. Well It seems I don't need any of this h

Re: [Tutor] trouble with "if"

2007-05-27 Thread adam urbas
I thank you much Alan. This has been very helpful already and I'm only on page 2. The world needs more newb-friendly people like you.> To: tutor@python.org> From: [EMAIL PROTECTED]> Date: Thu, 24 May 2007 23:39:41 +0100> Subject: Re: [Tutor] trouble with "if">

Re: [Tutor] trouble with "if"

2007-05-27 Thread adam urbas
t int trick, which I seem to have forgotten. And guess what that did it. It's amazing when you apply the things that you learn. Apparently I am quite absent minded. Well It seems I don't need any of this help anymore. Oh well. Thanks anyway.Au > To: tutor@python.org> Fro

Re: [Tutor] trouble with "if"

2007-05-27 Thread Brian van den Broek
adam urbas said unto the world upon 05/27/2007 01:49 PM: > Thank you for the help Brian. I would like to ask you about these > things. Which one of the examples you gave would be most fool > proof. Hi Adam and all, Adam was asking about how to use raw_input to drive a basic command prompt m

Re: [Tutor] trouble with "if"

2007-05-27 Thread adam urbas
Thank you for the help Brian. I would like to ask you about these things. Which one of the examples you gave would be most fool proof.> Date: Wed, 23 May 2007 13:40:09 -0400> From: [EMAIL PROTECTED]> To: [EMAIL PROTECTED]> CC: tutor@python.org> Subject: Re: [Tutor] trouble wi

Re: [Tutor] trouble with "if"

2007-05-24 Thread Alan Gauld
Hi adam. With the aid of Google it seems a Ti83 is a programmable calculator. I'm not sure what python tutor you are using but it looks like you need to cover some very basic stuff around data types. You may find the Raw Materials topic in my tutor useful to give you a feel for the different

Re: [Tutor] trouble with "if"

2007-05-24 Thread Alan Gauld
"adam urbas" <[EMAIL PROTECTED]> wrote > It won't even accept words. > I can only get it to accept numbers. try this(untested code!): number = None data = raw_input('Type something: ') try: number = int(data) except: data = data.split()# assume a string if number:# user entered a

Re: [Tutor] trouble with if

2007-05-24 Thread Che M
I'm not sure what the whole indentation thing is for. And now I'm having trouble with the if statement things. Maybe your if statement troubles have been solved by others by now, but I'll just add that "the indentation thing" is a vital feature of Python, it is the way to separate code blocks

Re: [Tutor] trouble with "if"

2007-05-23 Thread Eric Walstad
Hi Adam, adam urbas wrote: > when I input a radius, it says: > > can't multiply sequence by non-int of type 'float' ... > > radius=raw_input("Enter Radius:") > > diameter=(radius*2) After you collect the raw_input for the radius, the radius variable contains a string, not a number (that's what

Re: [Tutor] trouble with "if"

2007-05-23 Thread Brian van den Broek
> satisfied now, with the whole feeding). Well if I understood what > 'str' meant, then I could probably figure the rest out. Well I > have to go do other things so I'll save the rest of this figuring > out till later.I shall return,Adam> Date: Wed, 23 May 2007 12

Re: [Tutor] trouble with "if"

2007-05-23 Thread adam urbas
re the rest out. Well I have to go do other things so I'll save the rest of this figuring out till later.I shall return,Adam> Date: Wed, 23 May 2007 12:12:16 -0400> From: [EMAIL PROTECTED]> To: [EMAIL PROTECTED]> CC: tutor@python.org> Subject: Re: [Tutor] trouble with &qu

Re: [Tutor] trouble with "if"

2007-05-23 Thread adam urbas
;t want me to multiply by pi. PLEASE HELP!!!thanks in advance,Adam> Date: Wed, 23 May 2007 18:08:20 +0200> From: [EMAIL PROTECTED]> To: [EMAIL PROTECTED]> Subject: Re: [Tutor] trouble with "if"> CC: tutor@python.org> > The problem is with types. The outcome of

Re: [Tutor] trouble with "if"

2007-05-23 Thread adam urbas
AIL PROTECTED]> To: [EMAIL PROTECTED]> Subject: Re: [Tutor] trouble with "if"> CC: tutor@python.org> > The problem is with types. The outcome of raw_input is a string. But> if you give the line:> > if shape == 1:> > you are comparing it with a number. The t

Re: [Tutor] trouble with "if"

2007-05-23 Thread Eric Walstad
adam urbas wrote: > Hi all, > > I've been working with this new program that I wrote. ... > #"User's Choice:" > shape=raw_input("> ") > > #"Select Given:" > if shape == 1: ... [EMAIL PROTECTED]:~$ python Python 2.5.1 (r251:54863, May 2 2007, 16:56:35) [GCC 4.1.2 (Ubuntu 4.1.2-0ubunt

Re: [Tutor] trouble with "if"

2007-05-23 Thread Brian van den Broek
adam urbas said unto the world upon 05/23/2007 11:57 AM: > > Hi all, > > I've been working with this new program that I wrote. I started out > with it on a Ti-83, which is much easier to program than python. Now > I'm trying to transfer the program to python but its proving to be quite > dif

Re: [Tutor] trouble with "if"

2007-05-23 Thread Andre Engels
The problem is with types. The outcome of raw_input is a string. But if you give the line: if shape == 1: you are comparing it with a number. The text "1" is not equal to the number 1, so this evaluates to False. Instead you should do: if shape == "1": To also be able to type 'circle' instead