Solutions will be available when this assignment is resolved, or after a few failing attempts.

Append X

Write a function append_x that receives a string and appends the character 'X' to it ONLY if the string is not empty:

append_x('hello')  # hellox
append_x('')  # ''

Test Cases

test with empty string - Run Test

def test_with_empty_string():
    assert append_x('') == ''

test with valid string - Run Test

def test_with_valid_string():
    assert append_x('abc_') == 'abc_x'
def append_x(a_string): pass