solutions

String Length

Define a function string_length that receives a string and returns the length. Example:

string_length("abc")  # 3
string_length("Hello World")  # 11
string_length("")  # 0

Test Cases

test with empty string - Run Test

def test_with_empty_string():
    assert string_length("") == 0

test with length greater than 0 - Run Test

def test_with_length_greater_than_0():
    assert string_length("abcde") == 5