Skip to main content

This course is archived · This course is now in read-only mode. You can’t register or make new submissions anymore, but your previous work and results are still available.

05. functions - functies 0 of 6 activities solved
  1. ISBN Not yet solved
  2. Noah's headache Not yet solved
  3. Persistence Not yet solved
  4. Letter Boxed Not yet solved
  5. Writing's on the wall Not yet solved
  6. Tap code Not yet solved
Next series first evaluation (group 1) - eerste evaluatie (groep 1)
05. functions - functies

Noah's headache

This course is archived, so you can no longer hand in solutions.

def split(species): """ Splits the parameter (str) in a prefix and a suffix, where the prefix is formed by the longest sequence of consonants at the start of the parameter. >>> split('sheep') ('sh', 'eep') >>> split('goat') ('g', 'oat') """ def hybridize(species1, species2): """ Returns a tuple containing two strings. The first element of the tuple is formed by concatenating the prefix of the first parameter and the suffix of the second parameter. The second element of the tuple is formed by concatenating the prefix of the second parameter and the suffix of the first parameter. >>> hybridize('sheep', 'goat') ('shoat', 'geep') >>> hybridize('lion', 'tiger') ('jeopard', 'laguar') >>> hybridize('schnauzer', 'poodle') ('schnoodle', 'pauzer') """ if __name__ == '__main__': import doctest doctest.testmod()