About 50 results
Open links in new tab
  1. How to explain the int() function to a beginner - Stack Overflow

    Oct 25, 2017 · The third use case, "convert the string representation of a floating point number to an int " is not covered by the spec, because the language designers decided not to cover it. Which seems …

  2. Can you explain how int function(int()) works in Python?

    Feb 6, 2025 · Are you asking how it's possible to parse an int from a string, or are you asking for the source code to Python's built-in int function?

  3. python int ( ) function - Stack Overflow

    Aug 19, 2012 · 1 Use float () in place of int () so that your program can handle decimal points. Also, don't use next as it's a built-in Python function, next (). Also you code as posted is missing import sys and …

  4. Python: is 'int' a type or a function? - Stack Overflow

    In Python, the types have associated functions of the same name, that coerce their argument into objects of the named type, if it can be done. So, the type int <type 'int'> has a function int along with it.

  5. What does -> mean in Python function definitions?

    Jan 17, 2013 · 744 It's a function annotation. In more detail, Python 2.x has docstrings, which allow you to attach a metadata string to various types of object. This is amazingly handy, so Python 3 extends …

  6. python - why does "int" come before "input"? I would like to …

    Jan 8, 2024 · I would like to understand why the function: "int" comes first than "input" I expected the "input" function to be first than the "int" function since "input" has the function of requesting …

  7. python - What does base value do in int function? - Stack Overflow

    Apr 21, 2014 · The int() function can convert an integer in a base (or radix) other than 10 passed as a string, where the second parameter is the base of the number in the string, and the result will be an …

  8. How to return an int value from a function python

    How to return an int value from a function python Asked 11 years, 9 months ago Modified 8 years, 8 months ago Viewed 75k times

  9. python difference between round and int - Stack Overflow

    Apr 27, 2017 · Python has the four similar but subtly different functions because in different situations, you need different kinds of rounding. I suggest you first understand the different intentions between …

  10. What is the difference between int() and floor() in Python 3?

    5 Rounding down can be done in many ways, some methods are equivalent, e.g. built-in int, numpy.trunc and numpy.fix which truncate the number, meaning for a negative number they return a …