filter all the subcommands element through the lambda function with an argument x, that evaluates the method x.startswith,
print ( ' ' . join ( sorted ( filter ( lambda x : x . startswith ( curr ) , subcommands ) ) ) )