flavour
and size
. The function should print a message similar to this
average
which takes a list of numbers and returns their average.
average
function to return None
if the list is empty, and print a message like "The list is empty."
mymath.py
.
av
statistics
package to calculate the average (mean).
print_items
that takes any number of items and prints each one on a new line.
print_details
that takes an arbitrary number of keyword arguments representing details about something and prints each key-value pair.
IsReduplicated
that takes a word (in Malay) and returns True
if it has been reduplicated
and False
otherwise. Ignore case. Assume a reduplicated word is formed by repeating the base word with a hyphen between them, such as buku-buku (books) from buku "book".
IsReduplicated
to check the words.
informal
that takes a list
of words and return a list of words with reduplicated words replaced
by the informal version: e.g., word-word with word2.
update_inventory
that takes a dictionary representing current inventory and an arbitrary number of additional items. The function should add the new items to the inventory.
❂ If you haved finished everything else, try this
Functions are import for the following reasons:
LAC: Language and the Computer Francis Bond.