Go Back   CodingForums.com > :: Computing & Sciences > Computer Programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-26-2004, 08:25 PM   PM User | #1
velious
Regular Coder

 
Join Date: Jun 2003
Location: California
Posts: 231
Thanks: 0
Thanked 0 Times in 0 Posts
velious is an unknown quantity at this point
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?
velious is offline   Reply With Quote
Old 02-26-2004, 09:50 PM   PM User | #2
mordred
Senior Coder


 
Join Date: Jun 2002
Location: frankfurt, german banana republic
Posts: 1,848
Thanks: 0
Thanked 0 Times in 0 Posts
mordred is an unknown quantity at this point
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.
mordred is offline   Reply With Quote
Old 02-27-2004, 08:17 PM   PM User | #3
velious
Regular Coder

 
Join Date: Jun 2003
Location: California
Posts: 231
Thanks: 0
Thanked 0 Times in 0 Posts
velious is an unknown quantity at this point
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
velious is offline   Reply With Quote
Old 02-27-2004, 08:24 PM   PM User | #4
velious
Regular Coder

 
Join Date: Jun 2003
Location: California
Posts: 231
Thanks: 0
Thanked 0 Times in 0 Posts
velious is an unknown quantity at this point
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..
velious is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:25 AM.


Advertisement
Log in to turn off these ads.