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.

week 05: functions 0 of 6 activities solved
  1. ISBN Not yet solved
  2. Noah's headache Not yet solved
  3. Looking up Not yet solved
  4. Ergonomics Not yet solved
  5. Phone neighbours Not yet solved
  6. Turkey Irish Not yet solved
Next series week 06: evaluations
week 05: functions

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()