-1
Good afternoon! I am studying python3 (I am very beginner), and I would like, given a vector, to compare the elements of this vector 2 to 2 to see if they are equal. for example: [2,3,4,4,5] 2 compares with 3, and we have that 2!=3 3 compares with 4, and we have that 3!=4 4 compares with 4, and we have that 4==4 4 compares with 5, and we have that 4!=5
What I thought was something like
for x in vetor2:
if vetor2[x]==vetor2[x+1]:
Meanwhile, out of range... thank you!
Just iterate to the
length -1
.– Danizavtz
Hi! And how could I do that?
– Rômulo Rebello