Ok, I have this script that i wrote:
i=1024;
a=[0]*i;
for k in range(0,i):
a[k]=(k*k*k*k-74*k*k+173) % 1000033
print a
I don’t understand how to find the biggest number in the list AND its position.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Just keep a running track, then you don’t need the list:
Output:
P.S.
i = 1048576took a couple seconds and spat out:Note that it switched to long integers in there somewhere. This is with Python 2.6.1.
P.P.S. Also note that this method only finds the lowest index with the maximum. To get the highest index, replace the
<with<=: