Question: def abbreviate (word): ''' - Returns a string with (up to) the first three characters of the string word. - The value of word can
def abbreviate(word): ''' - Returns a string with (up to) the first three characters of the string word. - The value of word can be anything. - If word is not a string, return an empty string (""). ''' return "stub"
# Tests for abbreviate def test_abbreviate_1(): assert abbreviate("January") == "Jan" def test_abbreviate_2(): assert abbreviate(20) == "" def test_abbreviate_3(): assert abbreviate("At") == "At" def test_abbreviate_4(): assert abbreviate("T") == "T" def test_abbreviate_5(): assert abbreviate(["A", "T"]) == "" Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
