Question: Python contains all: given a list of integers, it returns True if the list contains all unique consecutive pos- itive integers starting from 1. The
Python
contains all: given a list of integers, it returns True if the list contains all unique consecutive pos- itive integers starting from 1. The order in which the elements appear in the list is not important. For example: >>> contains all([1, 2, 3, 4, 5]) True >>> contains all([3, 1, 2]) True >>> contains all([4, 5]) False >>> contains all([1, 1, 1]) False
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
