How can you simplify the expression?
policy = [] for i in res2: policy.append(tuple(i)) print policy How can you simplify the expression?
policy = [] for i in res2: policy.append(tuple(i)) print policy policy = [tuple(o) for o in res2] tuple function by replacing it with a construct using a literal: policy = [(o, ) for o in res2] - Timofei Bondarev(o, ) may lead to a different result - Kozlov Sergeimap(tuple, res2)
list function: policy = list(map(tuple, res2)) - Timofei BondarevSource: https://ru.stackoverflow.com/questions/55523/
All Articles