Basics

Robert Meegan rmeegan at murl.com
Thu Oct 14 14:42:10 EDT 1999


On Thu, 14 Oct 1999, Fergus Hayman wrote:

> Hi  Not sure how to declare a string
> 
>     print " Hello , what is your name"
>     name = raw_input()
>     Eric
>     print " Hello" , name
>     if name = =Eric:                # This line is wrong , not sure of
> string assignment ?
>             print " Your a bloke"
>     else:
>             print " Are you kidding"
> 
>  Thanks
> 
> 


The program:

print 'Hello, what is your name?'
name = raw_input()
print 'Hello,' name
if name == 'Eric':
	print "You're a bloke."
else:
	print 'Are you kidding?'


will do what you want.

I recommend that you spend a few minutes looking at the tutorial
before asking more questions like this.

http://www.python.org/doc/current/tut/tut.html

--- Robert


Robert Meegan

Murl.com - 
Because it's not just your data, it's your life.





More information about the Python-list mailing list