About 4,150,000 results
Open links in new tab
  1. python - ValueError: invalid literal for int () with base 10 ...

    Here you are trying to convert a string into int type which is not base-10. you can convert a string into int only if it is base-10 otherwise it will throw ValueError, stating invalid literal for int () with …

  2. c++ - int to unsigned int conversion - Stack Overflow

    You can convert an int to an unsigned int. The conversion is valid and well-defined. Since the value is negative, UINT_MAX + 1 is added to it so that the value is a valid unsigned quantity. …

  3. How do I generate a random integer in C#? - Stack Overflow

    How do I generate a random integer in C#?Random rnd = new Random(); int month = rnd.Next(1, 13); // creates a number between 1 and 12 int dice = rnd.Next(1, 7); // creates a number …

  4. c - Convert hex string (char []) to int? - Stack Overflow

    I have a char[] that contains a value such as "0x1800785" but the function I want to give the value to requires an int, how can I convert this to an int? I have searched around but cannot find an a...

  5. Long vs Integer, long vs int, what to use and when?

    Sometimes I see API's using long or Long or int or Integer, and I can't figure how the decision is made for that? When should I choose what?

  6. What is the difference between Integer and int in Java?

    An int variable holds a 32 bit signed integer value. An Integer (with capital I) holds a reference to an object of (class) type Integer, or to null. Java automatically casts between the two; from …

  7. How to fix TypeError: 'int' object is not subscriptable

    When you type x = 0 that is creating a new int variable (name) and assigning a zero to it. When you type x[age1] that is trying to access the age1 'th entry, as if x were an array.

  8. Is the size of C "int" 2 bytes or 4 bytes? - Stack Overflow

    Does an Integer variable in C occupy 2 bytes or 4 bytes? What are the factors that it depends on? Most of the textbooks say integer variables occupy 2 bytes. But when I run a program printing the

  9. python - TypeError: 'int' object is not callable - Stack Overflow

    Given the following: a = 23 b = 45 c = 16 round ( (a/b)*0.9*c) Running the above outputs an error: TypeError: 'int' object is not callable. How can I round the output to an integer?

  10. How can I convert a string to an int in Python? - Stack Overflow

    def convertStr(s): """Convert string to either int or float.""" try: ret = int(s) except ValueError: #Try float. ret = float(s) return ret That way if the int conversion doesn't work, you'll get a float …