Morgan and a String

  • + 0 comments

    Do you have any idea why i'm getting just half of the test cases? def morganAndString(a, b):

    # Write your code here
    morgan_str=''
    while len(a) > 0 and len(b) > 0:
        if a <= b:
            morgan_str+=a[0]
            a= a[1:]
        else:
            morgan_str+=b[0]
            b= b[1:]
    
    if len(a) == 0:
        morgan_str+=b
    else:
        morgan_str+=a
    return morgan_str