FAQ
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

Search Discussions

  • Robert Meegan at Oct 14, 1999 at 6:42 pm

    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.
  • Gubitz at Oct 14, 1999 at 8:45 pm
    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
    if name == "Eric":
    string assignment ?
    print " Your a bloke"
    else:
    print " Are you kidding"
    Thanks

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedOct 14, '99 at 6:11p
activeOct 14, '99 at 8:45p
posts3
users3
websitepython.org

People

Translate

site design / logo © 2022 Grokbase