Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

basic python programme

  • 11-09-2011 9:08pm
    #1
    Registered Users, Registered Users 2 Posts: 27


    Full_address="Firstname + ''+Surname\
    Address1\
    Address2\
    Address3\"
    Hi,
    i am looking for the syntax (if possible) to make the above work (i am getting syntax errors) so that i can save variables that i have created as a full block of output. I need to push the address onto the line below and not all on one line.
    please help...
    Tagged:


Comments

  • Closed Accounts Posts: 9,139 ✭✭✭-Trek-


    I think its the new line character your after "\n", i have included two ways of doing it, hope its what your looking for :)
    .
    >>> first_name = "First"
    >>> last_name = "Last"
    >>> address1 = "Address one"
    >>> address2 = "Address two"
    >>> address3 = "Address three"
    >>> print first_name + " " + last_name + "\n" + address1 + "\n" + address2 + "\n" + address3
    First Last
    Address one
    Address two
    Address three
    >>> 
    
    or
    >>> first_name = "First"
    >>> last_name = "Last"
    >>> address1 = "Address one"
    >>> address2 = "Address two"
    >>> address3 = "Address three"
    >>> print "%s %s\n%s\n%s\n%s" % (first_name, last_name, address1, address2, address3)
    First Last
    Address one
    Address two
    Address three
    >>>
    


  • Registered Users, Registered Users 2 Posts: 27 adrian7444


    thank you for your help (and everyone who replied).......really appreciate all the assistance

    i got the programme to do what i wanted:)

    adrian


Advertisement