Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /usr/bin/env python3.2
- # -*- coding: utf-8 -*-
- # main.py
- """ Task: Exercise 6.4
- There is a string method called count that is similar to the function in
- the previous exercise. Read the documentation of this method at
- docs.python.org/library/string.html and write an invocation that counts the
- number of times the letter a occurs in 'banana'.
- """
- ''' Main '''
- word = 'banana'
- print(word.count('a'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement