Posts by Vinicius Biondi • 21 points
1 post
-
2
votes3
answers331
viewsA: Avoiding code duplication without the use of switch/case in the Python language
If you simply want a smaller code you can also try a simplified loop in a function: def atribuiData(data): data_nova = [(data[1:2] + data[2::]) for i in range(1,9) if data[0:2] ==…