Question: What changes I can make in my code to run it on python 2 compiler? int (input ()) ar = [] bestvals = [] best_stored
What changes I can make in my code to run it on python 2 compiler?
int (input ()) ar = [] bestvals = [] best_stored = [] for x in range (n): ar.append (int(input ())) best_stored.append (0) best_stored[0] = 1 %3D for i in range (n): maxval = 1 %3D for j in range(i): if ar[i] % ar[j] == 0: maxval = max(maxval, (best_stored[j])+1) best_stored[i] = maxval print (max(best_stored))
Step by Step Solution
3.50 Rating (173 Votes )
There are 3 Steps involved in it
This code should run just fine on Python 2 however ... View full answer
Get step-by-step solutions from verified subject matter experts
