(May-16-2023, 09:52 PM)NewPi Wrote: I use Visual Studio Code and the Python extension.It's a method if look at source code.
When I hover over "random.choices(...)" it shows, that choices is a variable.
I don't understand. Isn't it a function?
Why it show a variable,is that in source there is this line
choices = _inst.choices
So
_inst.choices
is the method,if hover over will return.(method) def sample( population: Any, k: Any, *, counts: Any | None = None ) -> (list | Any) Chooses k unique random elements from a population sequence. .....You can get to this code bye press
Ctrl
and click when hover over choices.