Skip to main content
Function flow 0 of 5 activities solved
  1. Function Flow Not yet read
  2. Function Flow: quiz Not yet read
  3. Timely Extraction Not yet solved
  4. Volume Extraction Not yet solved
  5. String Extraction Not yet solved
Next series External functions
Function flow

String Extraction

Sign in to hand in your solution and get feedback.

from bakery import assert_equal def find_halfway(text: str) -> int: return int(len(text)/2) assert_equal(find_halfway("Banana"), 3) assert_equal(find_halfway("ABCDEFG"), 3) assert_equal(find_halfway("Half & Half"), 5) assert_equal(chop_half("Banana"), "Ban") assert_equal(chop_half("ABCDEFG"), "ABC") assert_equal(chop_half("Half & Half"), "Half ") if __name__ == "sandbox": print(chop_half("Banana")) print(chop_half("ABCDEFG"))