Re: Converting a string into a float that includes the negative

2015-11-08 Thread Pete Dowdell
On 08/11/15 09:11, phamton...@gmail.com wrote: I am having issue with converting the string into a float because there is a negative, so only end up with "ValueError: invalid literal for float(): 81.4]"81.4] The error is right there in the exception: you are trying to cast '81.4]' - that's a

Re: Converting a string into a float that includes the negative

2015-11-07 Thread phamtony33
On Saturday, November 7, 2015 at 9:40:49 PM UTC-5, MRAB wrote: > On 2015-11-08 02:11, phamton...@gmail.com wrote: > > I am having issue with converting the string into a float because there is > > a negative, so only end up with "ValueError: invalid literal for float(): > > 81.4]" > > > > def con

Re: Converting a string into a float that includes the negative

2015-11-07 Thread MRAB
On 2015-11-08 02:11, phamton...@gmail.com wrote: I am having issue with converting the string into a float because there is a negative, so only end up with "ValueError: invalid literal for float(): 81.4]" def contains_words(word,msg): if word in msg: return true

Converting a string into a float that includes the negative

2015-11-07 Thread phamtony33
I am having issue with converting the string into a float because there is a negative, so only end up with "ValueError: invalid literal for float(): 81.4]" def contains_words(word,msg): if word in msg: return true else: return false