Skip to content

Second Solution #2

@Mandraxed

Description

@Mandraxed

The following code works for snaplist.

def snaplist(a):
for i in range(0, len(a)-1):
if a[i] == a[i+1]:
print("Yes")
return
print("No")
a = [3, 4, 4, 8]
snaplist(a)

Your code has:
for i in range(0, len(a)-1-1) and does not work for repeated integers at the end of lists

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions