solutions

Characters in even positions

Write a function chars_in_even_positions that receives a string and returns all the characters in even positions. Example:

chars_in_even_positions('Marvelous')  # avlu
chars_in_even_positions('Python')  # yhn

Test Cases

test with even length - Run Test

def test_with_even_length():
    assert chars_in_even_positions('Python') == 'yhn'

test with odd length - Run Test

def test_with_odd_length():
    assert chars_in_even_positions('Respect') == 'epc'

test one characters - Run Test

def test_one_characters():
    assert chars_in_even_positions('X') == ''

test two characters - Run Test

def test_two_characters():
    assert chars_in_even_positions('No') == 'o'