Cody Bable

Generation

generate functionFri, 19 May 2023

create a function to split a string into pairs: "abcd" = "ab", "cd"

def split_into_pair(s): return s[0:2], s[2:4] split_into_pair("abcd")

Questions about programming?Chat with your personal AI assistant