nodups
that accepts a
list and returns True
if the list contains no duplicate elements; otherwise the
function returns False
. The function should not modify the
contents of the list.
count_evens
that accepts a list
containing integers. The function returns the number of even
numbers in the list. The function should not modify the
contents of the list.
is_prime
that accepts a single
integer value. The function returns True
is the number is a
prime number; otherwise, it returns False
.
The following shows how a client can make a
Rectangle
object:
Write a function named inside
that accepts a
Rectangle
object and a Point
object. The function returns True
if the point is inside the
bounds of the rectangle; otherwise, it returns False
.
distance
that accepts two point objects.
The function returns the distance between the two points.
myzip
that accepts two
list objects. The
function should return a new list containing 2-tuples, with the
first element of the first tuple equal to the first element in
the first list, and the second element of the first tuple equal to the
first element in the second list; first element of the second
tuple equal to the second element in
the second list, and the second element of the second tuple equal to the
second element in the second list, etc. The number of tuples
created is limited by the length of the shortest list. For example:
zip
function.
all_there
that accepts a string argument.
The function returns True
if the string contains
all the letters
of the alphabet A, B, C, ..., Z; otherwise, the function returns
False
. The capitalization of the letters does not matter.
The function ignores nonalphabetic characters. For example:
True
, but
False
(missing E and S).
listrange
that accepts a list
containing integers. The function returns the difference
between the largest value and smallest value in the list. Do
not use the built-in max
and min
functions.
The function should not modify the contents of the list. For
example:
common_factors
that accepts two
positive integer values. The function returns a list
of the positive factors they share. For example: