Advertisement
Mars83

6-4

Oct 9th, 2011
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. #! /usr/bin/env python3.2
  2. # -*- coding: utf-8 -*-
  3.  
  4. # main.py
  5. """ Task: Exercise 6.4
  6.    There is a string method called count that is similar to the function in
  7.    the previous exercise. Read the documentation of this method at
  8.    docs.python.org/library/string.html and write an invocation that counts the
  9.    number of times the letter a occurs in 'banana'.
  10. """
  11.  
  12. ''' Main '''
  13. word = 'banana'
  14. print(word.count('a'))
  15.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement