Skip to content
murmot

Results for “python array length function example pdf code site:discuss.python.org java”

  • discuss.python.org

    Discussions on Python.org

    Discussions related to the Python Programming Language, Python Community, and Python Software Foundation operations.

  • discuss.python.org

    In-place solution - Python Help - Discussions on Python.org

    Sep 7, 2022 · A simple coding question. I was wondering if my solution is “in-place”? Move Zeroes Given an integer array nums, move all 0 ’s to the end of it while maintaining the relative order of the non-zero elements. Note that you must do this in-place without making a copy of the array. Example 1: Input: nums = [0,1,0,3,12] Output: [1,3,12,0,0] Example 2: Input: nums = [0] Output: [0] class ...

  • discuss.python.org

    Add int.__length__ method - Ideas - Discussions on Python.org

    Jan 9, 2024 · An int is treated as a fixed width container of flags when performing embedded work in C. That definitely is not a Python integer, though. If you want that sort of integer, numpy has a set of defined-width types, and Python’s own struct module can pack and unpack them. But an integer, in Python, has no defined width and will not wrap around at any point. There are many ways you could define ...

  • discuss.python.org

    Comparing values in an array - Python Help - Discussions on ...

    Sep 8, 2022 · Hi, I am looking to write a short code to compare values in an array. For example, I want to have a list of values in a text file and then have each value compared to all of the other values to find out which ones are within 8 of each other. Example: 8, 9, 20, 22, 40, 39.

  • discuss.python.org

    PEP8 and line length - Ideas - Discussions on Python.org

    Mar 5, 2025 · The 80 char line length suggestion sort of feels like it’s from a different era. Does it still make sense to continue to soft-enforce this limit within changes to code or for cpython itself? Sometimes when looking at code, I’ve had to do some odd things to get a line to fit in 80 chars, especially in tests with a couple levels of indentation eating the first 8 chars. These odd things can ...

  • discuss.python.org

    Loop over an an array of array - Python Help - Discussions on ...

    Nov 28, 2023 · I have an array of arrays I want to loop over to return two arrays called hills and valleys. When looping through each element, we check the item at index 1 that is element[0] if the value is equal to zero, we create another array and push the value inside. we keep a trace of it still when we meet another element where the element[0] is greater than zero then the trace breaks after that we ...