Web Analytics Made Easy -
StatCounter python: values to strings - CodingForum


No announcement yet.

python: values to strings

  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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
      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
        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..