Recent Changes - Search:

PythonChallenge2

(:source lang=python:)

  1. !/usr/bin/env python

if __name__ == "__main__":

    data = open('input', 'r').read()

    chars = {}
    end = []

    for char in data:
        if not char in chars:
            chars[char] = 1
        else:
            chars[char] += 1 

    for char in data:
        if chars[char] < 5: 
            end.append(char)

    print ''.join(end)

(:sourceend:)

Page last modified by brett on May 04, 2012, at 11:01 PM