Posts by Gabriel • 29 points
5 posts
-
-2
votes1
answer74
viewsQ: Python, how to invert a chained list?
Hello, I need to create a function that receives an unordered list in the structure of nodes and it should reverse the order of the elements of that list, I tried to make a L[::-1] to reverse the…
-
1
votes3
answers253
viewsQ: How to resolve "Valueerror: max() Arg is an Empty Sequence" error when the list is empty?
This error appeared when I was testing my program, more precisely when the values of input do not satisfy the conditions imposed: n = int(input()) listaVelocidade = [] for _ in range(n): velocidades…
-
1
votes3
answers63
viewsQ: How NOT to separate a number of two or more digits when adding to a Python list?
I have a problem that, when iterating over a string and adding only the numbers in a list, a number (for example 13) eventually becomes ['1', '3']. How to get around this and make the number…
-
1
votes2
answers195
viewsQ: How to return a list where the size is set according to a number typed in the python input?
I would like the code I wrote to return a number of tuples according to the value entered in the input, for example, if the input is 3, the return will have to be 3 pairs of tuples. The following…
-
0
votes1
answer47
views