I'm writing a program which calculates the check digit of an ISBN number. I have to read the user's input (nine digits of an ISBN) into an integer variable, and then ...
Is it possible to find a defined sequence in an integer without converting it to a string?
That is, is it possible to do some form of pattern matching directly on integers.
I ...
I'm using python 3 for a small extra credit assignment to write an RSA cracker. The teacher has given us a fairly large (large enough to require more than 32 bits) ...
Assuming I have the float 12345.6789 and I want to get the six least significant digits (i.e. 45.6789) as an int (i.e. 456789) using bit operations in python (v. 2.6).
How do ...
I am looking for a general way to refer to particular digits in a integer or string, I need to be able to perform different operations on alternating digits and sum ...
I am trying to define a function that will include a variable n where n will be a string of numbers e.g. "3884892993", the definition of the function starts as is_true(n), ...