Solution 1

``````def banana_dict(num):
return {
('banana' * number): number for number in range(1, num + 1)
}
``````

# Introduction to Dictionaries

Write a function that receives a number X and creates a dictionary containing X elements. The elements will be the word `"banana"*X` and the number. If the number passed to the function is less than 1, return an empty dictionary.

``````banana_dict(2)
{
"banana": 1,
"bananabanana": 2
}
``````
``````banana_dict(4)
{
"banana": 1,
"bananabanana": 2,
"bananabananabanana": 3,
"bananabananabananabanana": 4
}
``````

### Test Cases

test dictionary with zero elements -

``````def test_dictionary_with_zero_elements():
assert banana_dict(0) == {}
``````

test dictionary with one element -

``````def test_dictionary_with_one_element():
assert banana_dict(1) == {'banana': 1}
``````

test dictionary with three elements -

``````def test_dictionary_with_three_elements():
assert banana_dict(3) == {
'banana': 1,
'bananabanana': 2,
'bananabananabanana': 3
}
``````
def banana_dict(): pass