Yes. It converts … well, any data type, really, to an int, and then you can do math on that value, via the normal Python syntax.
My point was that Int() is pre - formed… the author of this slide here is hopefully, before they switch to the next side, asking the classroom if there is anything wrong with their slide.
Small spelling errors are often trvial in written language, but uh… they’re kind of a very big deal in code.
You… could make a function that directly does some math operations on a string.
You could try to set up a bitshifting scheme, you could essentially make FancyMathInt(x,y), where x is converted to an int, and, perhaps hilariously, y is a string of math operations done to x, after y itself is parsed and converted to an instruction set…
There’s a lot of ways you could do that.
… Most of them are probably stupid, but, niche edges do sometimes arise where something like that could be useful.
IIRC int() doesn’t let you do math on strings, it converts strings into integers and then you can do math with those numbers.
Yes. It converts … well, any data type, really, to an int, and then you can do math on that value, via the normal Python syntax.
My point was that Int() is pre - formed… the author of this slide here is hopefully, before they switch to the next side, asking the classroom if there is anything wrong with their slide.
Small spelling errors are often trvial in written language, but uh… they’re kind of a very big deal in code.
You… could make a function that directly does some math operations on a string.
You could try to set up a bitshifting scheme, you could essentially make FancyMathInt(x,y), where x is converted to an int, and, perhaps hilariously, y is a string of math operations done to x, after y itself is parsed and converted to an instruction set…
There’s a lot of ways you could do that.
… Most of them are probably stupid, but, niche edges do sometimes arise where something like that could be useful.