About 76,100 results
Open links in new tab
  1. Python: Declare as integer and character - Stack Overflow

    Feb 26, 2017 · In python, you can't do static typing (i.e. you can't fix a variable to a type). Python is dynamic typing. What you need is to force a type to the input variable.

  2. How to create an integer array in Python? - Stack Overflow

    Dec 7, 2009 · Also: as many others have noted including Pi and Ben James, this creates a list, not a Python array. While a list is in many cases sufficient and easy enough, for performance …

  3. python - Checking whether a variable is an integer or not - Stack …

    Aug 17, 2010 · This adheres to Python's strong polymorphism: you should allow any object that behaves like an int, instead of mandating that it be one. BUT. The classical Python mentality, …

  4. python - Maximum and Minimum values for ints - Stack Overflow

    Sep 30, 2011 · So on a 64-bit system, Python integers are implemented as an array of 32-bit integers storing the absolute value of the integer (but 2 of the bits of each integer aren't used) …

  5. integer - How does Python manage int and long? - Stack Overflow

    The Max value of the default Int in Python 2 is 65535, anything above that will be a long. For example: >> print type(65535) <type 'int'> >>> print type(65536*65536) <type 'long'> In Python …

  6. python - How do I define a function with optional arguments?

    A Python function can take in some arguments, take this for example, def add(x,y): return x+ y # calling this will require only x and y add(2,3) # 5 If we want to add as many arguments as we …

  7. Python Variable Declaration - Stack Overflow

    Jun 13, 2012 · Python will ignore the class attribute Example.name whenever we look up the .name of an instance, because the instance's attribute will be found first. One last caveat: …

  8. python - How can I read inputs as numbers? - Stack Overflow

    Dec 8, 2013 · Differences between Python 2 and 3. Summary. Python 2's input function evaluated the received data, converting it to an integer implicitly (read the next section to understand the …

  9. Creating my own "integer" object in Python - Stack Overflow

    Apr 9, 2011 · So, class Integer(int) should be used in order to Python allows you to use the custom variable for the same things the standard int is used. Based on juanchopanza 's …

  10. Integer array in Python - Stack Overflow

    May 25, 2010 · import array pos = array.array('l', 7 * [99]) The array module of Python's standard library is the only way to make an array that comes with Python (the third-party module numpy …

Refresh