[Tutor] pyhton

Danny Yoo dyoo@hkn.eecs.berkeley.edu
Tue, 25 Dec 2001 11:28:10 -0800 (PST)


On Mon, 24 Dec 2001, Ted R. wrote:

> hello my name is ted and i have a few questions about pyhton. i have

Hi Ted, welcome to Tutor!


> never worked with programing but i have worked with computers for a
> while. i am 15 so i have done more jovinial "cracking" like gameshark
> codes and gameshark hacking etc. after a while i got bored so i
> dicided to go into somthing were i could expand to a future carrier,
> so i started to look at computer programing, and a herd that python
> was the easieats and all around best. but to my question do you know
> any were it gives more "hands on traingin" and more in depth help.


We'll do what we can to help you; please feel free to ask questions
anytime.


> also i cannot get this program to work maby you can tell me whats
> wrong?
> 
> 
> >>>input("what is your name?") if ted print"hello ted" else: print"who
> are you?"


Hmmm...  can you try this from the IDLE editor?  Here's a web site that
might help you get started:

    http://hkn.eecs.berkeley.edu/~dyoo/python/idle_intro


Also, is that command all on one line?  You might want to do this instead:


###
name = raw_input("what is your name?")
if name == "ted":
    print "hello ted"
else:
    print "who are you?"
###

(I'm putting pound signs here to separate it from the message here; you
don't have to type them)  I've changed some of the commands so that they
work better --- raw_input() is easier to get working right than input(),
and we can talk about this more when you want.

Also, in Python, indentation matters, so it does make a difference when we
put things in lines and columns.  Tell us if this works for you.



Good luck!  Again, if you have questions, please feel free to talk to us.  
We might be a little less responsive than usual since it's the holidays,
but we'll try to reply quickly.