d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Python Assistance > List Separation
Prev12
Add Reply New Topic New Poll
Member
Posts: 4,625
Joined: Jul 3 2009
Gold: 6,520.00
Jun 29 2014 03:53pm
Quote (mebeatyou @ Jun 29 2014 05:51pm)
If you wanna post full code here I can try and run it myself and see if I can help you debug


I think it's not working because it shows n/2 is a float of 3.0, trying to fix it lol
Member
Posts: 6,481
Joined: Jul 5 2009
Gold: 0.70
Jun 29 2014 03:55pm
Quote (SleepyUnit @ Jun 29 2014 05:53pm)
I think it's not working because it shows n/2 is a float of 3.0, trying to fix it lol


Oh shoot I probably should have thought of that.

I had this same problem moving from python2 to python3. I ended up having to wrap almost all of my calculations in "int()"

int(n/2) or int(floor(n/2))
Member
Posts: 4,625
Joined: Jul 3 2009
Gold: 6,520.00
Jun 29 2014 03:56pm
Quote (mebeatyou @ Jun 29 2014 05:55pm)
Oh shoot I probably should have thought of that.

I had this same problem moving from python2 to python3. I ended up having to wrap almost all of my calculations in "int()"

int(n/2) or int(floor(n/2))


yep just looked up how to do casting lol.
half = int(n/2)

is what i put now

thanks very much for the help :)
i'll donate once I get this full working

This post was edited by SleepyUnit on Jun 29 2014 03:56pm
Member
Posts: 4,625
Joined: Jul 3 2009
Gold: 6,520.00
Jun 29 2014 04:08pm
All working now. Thanks, all the problems because float != int and python 2 & 3 lol.
Go Back To Programming & Development Topic List
Prev12
Add Reply New Topic New Poll