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 workaround, I've tried using while, if and max (), but none of these are working.
With the max () function for example, my code looks like this:
list1 = client.recv (2048) // I get the random server list
print list1 // write the list on the screen
response = max (list1) // calculating the maximum value of the list
print response // write response on screen
client.send (response) // send response to 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
] // "response" result, that is, value that was sent to the server
Err, try again. // Server response stating that the value entered is not correct
Does anyone know what I'm doing wrong? or do you have any other solution for writing this code?
Thank you in advance, hugs.