Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question about python function., about ""-marks

    So when i type
    a = [1]

    a.append ("lol")
    i get a = [1, 'lol']

    when using a.append (lol)
    i get a = [1, lol]

    I wonder does the interpreter think the lol are different things or what?
    what does the ""-marks add for difference to the interpreter?

  • #2
    New Coder
    Join Date
    Jan 2012
    Posts
    96
    Thanks
    1
    Thanked 13 Times in 13 Posts
    Quote Originally Posted by runeazn View Post
    So when i type
    a = [1]

    a.append ("lol")
    i get a = [1, 'lol']

    when using a.append (lol)
    i get a = [1, lol]

    I wonder does the interpreter think the lol are different things or what?
    what does the ""-marks add for difference to the interpreter?
    Oh good ole python. Don't use append you have to write to replace the 1 with lol

    a.write("lol")
    Last edited by sean3838; 01-11-2012 at 10:09 PM.

  • #3
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thats not what i meant

    i mean when i type ("lol") i get 'lol'
    and when i type (lol) i get lol
    whats the difference between these two?

    those quote marks must mean something for the interpreter.


  •  

    Posting Permissions

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