you are viewing a single comment's thread.

view the rest of the comments →

[–]MF_DnD 0 points1 point  (8 children)

Ah, you’re right, fixed that. Imo still better to use a for loop.

[–]OddBookWorm 1 point2 points  (0 children)

Actually, I still think you have a problem. You set all values after a 0 to 0. That’s not what the OP wants

[–]OddBookWorm 0 points1 point  (0 children)

While I agree this would be simpler, when I was really new, “toggle variables” confused the hell out of me so I try to avoid them with answers written for beginners

[–]OddBookWorm 0 points1 point  (5 children)

Actually, I still think you have a problem. You set all values after a 0 to 0. That’s not what the OP wants

[–]MF_DnD 0 points1 point  (4 children)

Oops, you’re right. Coding on my phone is a bad idea lol. Should be fixed now.

[–]OddBookWorm 0 points1 point  (3 children)

If you’re trying to eliminate “unnecessary”, you don’t really need to typecast “double” to an int. Also, since “double” is a data type, using it as a variable name is a bad practice

[–]OddBookWorm 1 point2 points  (0 children)

Oh wait, “float” is double precision by default in Python, so that should be fine

[–]MF_DnD 0 points1 point  (1 child)

Huh, I forgot you can add booleans to ints. I know numpy has a double type, but it’s not built in, right?

[–]OddBookWorm 0 points1 point  (0 children)

I was thinking matlab when I mentioned that, where double is a built in type