def fun(words:list):
code...
How can I indicate that an argument should be a list of lists? All I can think about is doing something like this:
def fun(words:(list,list)):
code...
Would that be understandable?
def fun(words:list):
code...
How can I indicate that an argument should be a list of lists? All I can think about is doing something like this:
def fun(words:(list,list)):
code...
Would that be understandable?
You could use the typing
module:
from typing import List
def fun(l: List[list]):
code...
© 2022 - 2024 — McMap. All rights reserved.