About 13,000,000 results
Open links in new tab
  1. slice - How slicing in Python works - Stack Overflow

    Python slicing is a computationally fast way to methodically access parts of your data. In my opinion, to be even an intermediate Python programmer, it's one aspect of the language that it is necessary to …

  2. What does the "at" (@) symbol do in Python? - Stack Overflow

    Functions, in Python, are first class objects - which means you can pass a function as an argument to another function, and return functions. Decorators do both of these things. If we stack decorators, the …

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

    466 I have a Python function which takes several arguments. Some of these arguments could be omitted in some scenarios.

  4. mean in Python function definitions? - Stack Overflow

    Jan 17, 2013 · In more recent versions of Python >= 3.5, though, it has a defined meaning. PEP 3107 -- Function Annotations described the specification, defining the grammar changes, the existence of …

  5. python - What does ** (double star/asterisk) and * (star/asterisk) do ...

    Aug 31, 2008 · BONUS: From python 3.8 onward, one can use / in function definition to enforce positional only parameters. In the following example, parameters a and b are positional-only, while c …

  6. python - What do * (single star) and / (slash) do as independent ...

    Jan 9, 2020 · The function parameter syntax (/) is to indicate that some function parameters must be specified positionally and cannot be used as keyword arguments. (This is new in Python 3.8) …

  7. python - How to pass an input argument when creating an instance of …

    My idea was to implement the following class: class name (object, name): def __init__ (self, name): print name Then the idea was to create two instances of that class: person1 = name ("

  8. python - Normal arguments vs. keyword arguments - Stack Overflow

    Sep 13, 2009 · 25 Using Python 3 you can have both required and non-required keyword arguments: Optional: (default value defined for param 'b')

  9. How do I declare an array in Python? - Stack Overflow

    Aug 23, 2022 · Python has an independent implementation of array() in the standard library module array " array.array() " hence it is incorrect to confuse the two. Lists are lists in python so be careful …

  10. Explicitly Define Datatype in Python Function - Stack Overflow

    I want to define 2 variables in python function and define them as float explicitly. However, when i tried to define them in the function parameter, it's showing syntax error.