View Poll Results: What do youi use most to string, ' or "?

Voters
25. You may not vote on this poll
  • I use " most of the time(please post why)

    9 36.00%
  • I use ' most of the time(please post why)

    10 40.00%
  • I use both/ I use " to .../ I use ' to ...(please post where you use it, and why)

    6 24.00%
Page 2 of 2 FirstFirst 12
Results 11 to 20 of 20

Thread: Python: ' or "?

  1. #11
    Join Date
    Oct 2005
    Location
    Davao, Philippines
    Beans
    4,830

    Re: Python: ' or "?

    double qoutes , because string interpolation is a usual task.

  2. #12
    Join Date
    Dec 2006
    Location
    Australia
    Beans
    1,097
    Distro
    Xubuntu 15.10 Wily Werewolf

    Re: Python: ' or "?

    Quote Originally Posted by LaRoza View Post
    I generally use double quotes for strings, in any language. I use single quotes for characters (guess what language I also use), and for a few other things.
    Same here.

  3. #13
    Join Date
    Feb 2005
    Location
    Pennsylvania; USA
    Beans
    176

    Re: Python: ' or "?

    I use " when typing strings and ' when using characters.

    Yes, I come from Java.

  4. #14
    Join Date
    Mar 2007
    Location
    Lyngen, Norway
    Beans
    163
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: Python: ' or "?

    I forgot to say I use ' most of my time.

    I only use " when:
    Code:
    print("hello")
    IBM Thinkpad R60
    Ubuntu user: # 14440
    Please visit:
    http://www.fablab.no

  5. #15
    Join Date
    Apr 2005
    Location
    Sweden
    Beans
    481
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Python: ' or "?

    Quote Originally Posted by LaRoza View Post
    I generally use double quotes for strings, in any language. I use single quotes for characters (guess what language I also use), and for a few other things.
    +1
    Hackers of the world, unite!

  6. #16
    Join Date
    Nov 2006
    Location
    Israel
    Beans
    765
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Python: ' or "?

    Quote Originally Posted by LaRoza View Post
    I generally use double quotes for strings, in any language. I use single quotes for characters (guess what language I also use), and for a few other things.
    I find myself doing similar things. Occasionally I slip in to php mode in which I nearly always use single quotes (since then the php parser doesn't have to look for $ and { signs - minor performance gain).
    Intel E6300 / MSI P4M890M / 2GB DDR2 677 / 80GB + 1TB SATA2 / GeForce 6200TC / DL DVD+-RW / Dell 24" U2410

  7. #17
    Join Date
    Jun 2006
    Location
    CT, USA
    Beans
    5,267
    Distro
    Ubuntu 6.10 Edgy

    Re: Python: ' or "?

    Worst use of single quote for me is in VisualBasic: it starts comments till end of line. Horrible idea.

  8. #18
    Join Date
    Oct 2007
    Location
    Dublin, Ireland
    Beans
    13
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: Python: ' or "?

    I tend to mix... My java and perl background mean I use double most of the time. Sometimes I'll use single for characters or strings that I consider to be pretty constant, but that's down to a very tenuous line in my head.

    In short: Most of the time I use double - but there is a place for single in my world.

    Aoife

  9. #19
    Join Date
    Nov 2005
    Beans
    593
    Distro
    Kubuntu 7.10 Gutsy Gibbon

    Re: Python: ' or "?

    I use single quotes because with my keyboard layout it requires less keystrokes (just press ' instead of shift + ' for ").

  10. #20
    Join Date
    Apr 2007
    Beans
    Hidden!

    Re: Python: ' or "?

    Less key strokes and same string character as SQL.

Page 2 of 2 FirstFirst 12

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •