0
I have the following problem:
I need to create a program that reads a random list of positive and negative values, and returns the highest value. As a solution, I have tried using while, if and max(), but none of these are working.
With max() for example, my code is like this:
lista1 = client.recv(2048) // I get the random list from the server
print list1 // I write the list on the screen
answer = max(list 1) // calculating the maximum value of the list
print reply // I write the answer on the screen
client.send(reply) // send the reply to the server
As a result, I’m getting the following:
[4367859, 9736628, -530197, -5556671, 8246498, 3478110, -8101840, 3049971, 9121277, -4665343] // random list that is generated by server
] // "reply" result, that is, value that was sent to the server
Wrong, try it again. //server response stating that the entered value is not correct
Does anyone know what I’m doing wrong? or if there’s any other solution to writing this code?
Thanks in advance, hugs.
It worked, thank you very much!!!
– ViniciusCari