# Python's list operations, as Vibe proves and runs them
def main() -> None:
    xs: list[int] = [5, 3, 8, 3, 1]
    print(xs.index(3), xs.count(3), 8 in xs, 7 not in xs)
    xs.remove(3)
    print(len(xs), xs[1])
    xs.reverse()
    print(xs[0], xs[3])
    both: list[int] = xs + xs
    print(len(both))
    twice: list[int] = xs * 2
    thrice: list[int] = 3 * xs
    print(len(twice), len(thrice))
    print(min(xs), max(xs), sum(x for x in range(5)), sum((x for x in range(5)), 100))
    ordered: list[int] = sorted(xs)
    print(ordered[0], ordered[3])
    xs.sort()
    print(xs[0], xs[1], xs[2], xs[3])
    back: list[int] = list(reversed(xs))
    print(back[0])
    last: int = xs.pop()
    print(last, len(xs))
    xs.pop()
    xs.pop(0)
    print(len(xs), xs[0])
    del xs[0]
    print(len(xs))
    xs.extend(back)
    xs.append(0)
    print(len(xs))
    flags: list[bool] = [True, False, True]
    print(any(flags), all(flags))
    xs.clear()
    print(len(xs))


if __name__ == "__main__":
    main()
