"""

Exercise 2

There is a string method called count that is similar to the function in Section 8.7.
Read the documentation of this method and write an invocation that counts the number of a’s in 'banana'.

str.count(sub[, start[, end]])¶

    Return the number of non-overlapping occurrences of substring sub in the range [start, end].
    Optional arguments start and end are interpreted as in slice notation.
"""

string = 'banana'

print(string.count('a'))
