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 4 of 4
  1. #1
    Regular Coder
    Join Date
    Jun 2003
    Location
    California
    Posts
    231
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question python: values to strings

    If anyone has the 2.3.3 python documentation then you can find this in the tutorials on number 7. if you dont then i hope you know what i am talking about.

    a part of the page says this:
    "One question remains, of course: how do you convert values to strings? Luckily, Python has ways to convert any value to a string: pass it to the repr() or str() functions. Reverse quotes (``) are equivalent to repr(), but their use is discouraged. "

    2.3.3 is the most updated version of python yet they discourage the use of repr() and str() functions.. What do i use in replacement of those functions?

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    frankfurt, german banana republic
    Posts
    1,848
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Uhm... *scratches his head*

    Are you sure you put the last sentence into the right context? I read it as if the backticks (reverse quotes) were meant with "their use", and that they (the reverse quotes) should not be used. AFAIK know, using str() and repr() is fine.
    De gustibus non est disputandum.

  • #3
    Regular Coder
    Join Date
    Jun 2003
    Location
    California
    Posts
    231
    Thanks
    0
    Thanked 0 Times in 0 Posts
    yes mordred that last sentense is correct..unless you have the 2.3.3 documentation of python, dont know how else to explain it.
    no big deal

  • #4
    Regular Coder
    Join Date
    Jun 2003
    Location
    California
    Posts
    231
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question add on to the above: properties

    I understand objects, and methods but properties are something that i cant seem to grasp at why they are so important..

    for example:

    "car" is the object and "red" would be a property of the car..so would leather seats. Why do the properties matter..as long as the object does what its susposed to do?.

    properties such as the color and type of seats dont affect the performance of the car..


  •  

    Posting Permissions

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