DEV Community

Durga Pokharel
Durga Pokharel

Posted on

Day 21 Of 100Daysofcode: Written Simple Class To Read Local File And Find The Occurrence Of Numbers and Words.

Today I gave my time to learn more about regular expression. I tried to write my simple project on the basic CSS. Also I learned more properties of CSS from Freecodecamp.

Tried to write code related to python with the help of friend and goggle. I tried to write simple class which read data from given file find numbers, words, occurrence of words and occurrence of numbers.

File Handler Class:

I learned while study a class is like an object constructor, or a "blueprint" for creating objects. My simple code regarding to the class which able to read the data from given file. Find out the numbers present in the file, words in a file and find out occurance of same numbers and words from the given data is given below.
Initialize the class by giving file directory.Read the file and place each line in the list.
Initialize empty list as attribute of class to store each number and each words. Initialize empty dictionary as attribute of class to store each occurrence of number and words.

import re
class FileHandler:
    def __init__(self,filename = None):
        self.file = open(filename)
        self.lines = [line.strip() for line in self.file.readlines()]
        self.numbers = []
        self.words = []
        self.num_occur = {}
        self.word_occur = {}

Enter fullscreen mode Exit fullscreen mode

Method to find all the words in file and place it in list declared earlier.

   def get_words(self):
        total = []
        for line in self.lines:

            line = line.rstrip()
            words = re.findall('(?!\d)\w+',line)
            #print(type(words))
            if len(words) == 0 :continue
            total.extend(words)
        self.words = total
        return self.words
Enter fullscreen mode Exit fullscreen mode

Tried to make method to find all the numbers in file and place it in list declared earlier.

  def get_numbers(self):
        total = []
        for line in self.lines:
            line = line.rstrip()
            numbers = re.findall('[0-9]+',line)
            if len(numbers) == 0:continue
            num = [int(i) for i in numbers]
            total.extend(num)
        self.numbers = total
        return self.numbers
Enter fullscreen mode Exit fullscreen mode

Make a method to find occurrence of each number in file. For this I make a dictioanry earlier. Kept the numbers as a key and numbers of number occurre as a value.

 def get_occur_numbers(self):
        for key in self.numbers:
            if self.num_occur.get(key) is not None:
                self.num_occur[key] += 1
            else:
                self.num_occur[key] = 1
        return self.num_occur

Enter fullscreen mode Exit fullscreen mode

Make a method to find occurrence of each word in file. For this I make a dictioanry earlier. Kept the words as a key and numbers of words occure as a value..

 def get_occur_words(self):
        for key in self.words:
            if self.word_occur.get(key) is not None:
                self.word_occur[key] += 1
            else:
                self.word_occur[key] = 1
        return self.word_occur

Enter fullscreen mode Exit fullscreen mode

And this is from where I called method

fhand = FileHandler('file2.txt')
print(fhand.get_words())
print(fhand.get_numbers())
print(fhand.get_occur_numbers())
print(fhand.get_occur_words())
Enter fullscreen mode Exit fullscreen mode

And my Full code look like below

import re
class FileHandler:
    def __init__(self,filename = None):
        self.file = open(filename)
        self.lines = [line.strip() for line in self.file.readlines()]
        self.numbers = []
        self.words = []
        self.num_occur = {}
        self.word_occur = {}


    def get_words(self):
        total = []
        for line in self.lines:

            line = line.rstrip()
            words = re.findall('(?!\d)\w+',line)
            #print(type(words))
            if len(words) == 0 :continue
            total.extend(words)
        self.words = total
        return self.words


    def get_numbers(self):
        total = []
        for line in self.lines:
            line = line.rstrip()
            numbers = re.findall('[0-9]+',line)
            if len(numbers) == 0:continue
            num = [int(i) for i in numbers]
            total.extend(num)
        self.numbers = total
        return self.numbers


    def get_occur_numbers(self):
        for key in self.numbers:
            if self.num_occur.get(key) is not None:
                self.num_occur[key] += 1
            else:
                self.num_occur[key] = 1
        return self.num_occur



    def get_occur_words(self):
        for key in self.words:
            if self.word_occur.get(key) is not None:
                self.word_occur[key] += 1
            else:
                self.word_occur[key] = 1
        return self.word_occur



fhand = FileHandler('file2.txt')
print(fhand.get_words())
print(fhand.get_numbers())
print(fhand.get_occur_numbers())
print(fhand.get_occur_words())
Enter fullscreen mode Exit fullscreen mode

When this code is run we get following output

['This', 'file', 'contains', 'the', 'actual', 'data', 'for', 'your', 'assignment', 'good', 'luck', 'Why', 'should', 'you', 'learn', 'to', 'write', 'programs', 'Writing', 'programs', 'or', 'programming', 'is', 'a', 'very', 'creative', 'and', 'rewarding', 'activity', 'You', 'can', 'write', 'programs', 'for', 'many', 'reasons', 'ranging', 'from', 'making', 'your', 'living', 'to', 'solving', 'a', 'difficult', 'data', 'analysis', 'problem', 'to', 'having', 'fun', 'to', 'helping', 'someone', 'else', 'solve', 'a', 'problem', 'This', 'book', 'assumes', 'that', 'everyone', 'needs', 'to', 'know', 'how', 'to', 'program', 'and', 'that', 'once', 'you', 'know', 'how', 'to', 'program', 'you', 'will', 'figure', 'out', 'what', 'you', 'want', 'to', 'do', 'with', 'your', 'newfound', 'skills', 'We', 'are', 'surrounded', 'in', 'our', 'daily', 'lives', 'with', 'computers', 'ranging', 'from', 'laptops', 'to', 'cell', 'phones', 'We', 'can', 'think', 'of', 'these', 'computers', 'as', 'our', 'personal', 'assistants', 'who', 'can', 'take', 'care', 'of', 'many', 'things', 'on', 'our', 'behalf', 'The', 'hardware', 'in', 'our', 'current', 'day', 'computers', 'is', 'essentially', 'built', 'to', 'continuously', 'ask', 'us', 'the', 'question', 'What', 'would', 'you', 'like', 'me', 'to', 'do', 'next', 'Programmers', 'add', 'an', 'operating', 'system', 'and', 'a', 'set', 'of', 'applications', 'to', 'the', 'hardware', 'and', 'we', 'end', 'up', 'with', 'a', 'Personal', 'Digital', 'Assistant', 'that', 'is', 'quite', 'helpful', 'and', 'capable', 'of', 'helping', 'us', 'do', 'many', 'different', 'things', 'Our', 'computers', 'are', 'fast', 'and', 'have', 'vast', 'amounts', 'of', 'memory', 'and', 'could', 'be', 'very', 'helpful', 'to', 'us', 'if', 'we', 'only', 'knew', 'the', 'language', 'to', 'speak', 'to', 'explain', 'to', 'the', 'computer', 'what', 'we', 'would', 'like', 'it', 'to', 'do', 'next', 'If', 'we', 'knew', 'this', 'language', 'we', 'could', 'tell', 'the', 'computer', 'to', 'do', 'tasks', 'on', 'our', 'behalf', 'that', 'were', 'repetitive', 'Interestingly', 'the', 'kinds', 'of', 'things', 'computers', 'can', 'do', 'best', 'are', 'often', 'the', 'kinds', 'of', 'things', 'that', 'we', 'humans', 'find', 'boring', 'and', 'mind', 'numbing', 'For', 'example', 'look', 'at', 'the', 'first', 'three', 'paragraphs', 'of', 'this', 'chapter', 'and', 'tell', 'me', 'the', 'most', 'commonly', 'used', 'word', 'and', 'how', 'many', 'times', 'the', 'word', 'is', 'used', 'While', 'you', 'were', 'able', 'to', 'read', 'and', 'understand', 'the', 'words', 'in', 'a', 'few', 'seconds', 'counting', 'them', 'is', 'almost', 'painful', 'because', 'it', 'is', 'not', 'the', 'kind', 'of', 'problem', 'that', 'human', 'minds', 'are', 'designed', 'to', 'solve', 'For', 'a', 'computer', 'the', 'opposite', 'is', 'true', 'reading', 'and', 'understanding', 'text', 'from', 'a', 'piece', 'of', 'paper', 'is', 'hard', 'for', 'a', 'computer', 'to', 'do', 'but', 'counting', 'the', 'words', 'and', 'telling', 'you', 'how', 'many', 'times', 'the', 'most', 'used', 'word', 'was', 'used', 'is', 'very', 'easy', 'for', 'the', 'computer', 'Our', 'personal', 'information', 'analysis', 'assistant', 'quickly', 'told', 'us', 'that', 'the', 'word', 'to', 'was', 'used', 'sixteen', 'times', 'in', 'the', 'first', 'three', 'paragraphs', 'of', 'this', 'chapter', 'This', 'very', 'fact', 'that', 'computers', 'are', 'good', 'at', 'things', 'that', 'humans', 'are', 'not', 'is', 'why', 'you', 'need', 'to', 'become', 'skilled', 'at', 'talking', 'computer', 'language', 'Once', 'you', 'learn', 'this', 'new', 'language', 'you', 'can', 'delegate', 'mundane', 'tasks', 'to', 'your', 'partner', 'the', 'computer', 'leaving', 'more', 'time', 'for', 'you', 'to', 'do', 'the', 'things', 'that', 'you', 'are', 'uniquely', 'suited', 'for', 'You', 'bring', 'creativity', 'intuition', 'and', 'inventiveness', 'to', 'this', 'partnership', 'Creativity', 'and', 'motivation', 'While', 'this', 'book', 'is', 'not', 'intended', 'for', 'professional', 'programmers', 'professional', 'programming', 'can', 'be', 'a', 'very', 'rewarding', 'job', 'both', 'financially', 'and', 'personally', 'Building', 'useful', 'elegant', 'and', 'clever', 'programs', 'for', 'others', 'to', 'use', 'is', 'a', 'very', 'creative', 'activity', 'Your', 'computer', 'or', 'Personal', 'Digital', 'Assistant', 'PDA', 'usually', 'contains', 'many', 'different', 'programs', 'from', 'many', 'different', 'groups', 'of', 'programmers', 'each', 'competing', 'for', 'your', 'attention', 'and', 'interest', 'They', 'try', 'their', 'best', 'to', 'meet', 'your', 'needs', 'and', 'give', 'you', 'a', 'great', 'user', 'experience', 'in', 'the', 'process', 'In', 'some', 'situations', 'when', 'you', 'choose', 'a', 'piece', 'of', 'software', 'the', 'programmers', 'are', 'directly', 'compensated', 'because', 'of', 'your', 'choice', 'If', 'we', 'think', 'of', 'programs', 'as', 'the', 'creative', 'output', 'of', 'groups', 'of', 'programmers', 'perhaps', 'the', 'following', 'figure', 'is', 'a', 'more', 'sensible', 'version', 'of', 'our', 'PDA', 'For', 'now', 'our', 'primary', 'motivation', 'is', 'not', 'to', 'make', 'money', 'or', 'please', 'end', 'users', 'but', 'instead', 'for', 'us', 'to', 'be', 'more', 'productive', 'in', 'handling', 'the', 'data', 'and', 'information', 'that', 'we', 'will', 'encounter', 'in', 'our', 'lives', 'When', 'you', 'first', 'start', 'you', 'will', 'be', 'both', 'the', 'programmer', 'and', 'the', 'end', 'user', 'of', 'your', 'programs', 'As', 'you', 'gain', 'skill', 'as', 'a', 'programmer', 'and', 'programming', 'feels', 'more', 'creative', 'to', 'you', 'your', 'thoughts', 'may', 'turn', 'toward', 'developing', 'programs', 'for', 'others', 'Computer', 'hardware', 'architecture', 'Before', 'we', 'start', 'learning', 'the', 'language', 'we', 'speak', 'to', 'give', 'instructions', 'to', 'computers', 'to', 'develop', 'software', 'we', 'need', 'to', 'learn', 'a', 'small', 'amount', 'about', 'how', 'computers', 'are', 'built', 'Central', 'Processing', 'Unit', 'or', 'CPU', 'is', 'the', 'part', 'of', 'the', 'computer', 'that', 'is', 'built', 'to', 'be', 'obsessed', 'with', 'what', 'is', 'next', 'If', 'your', 'computer', 'is', 'rated', 'at', 'three', 'Gigahertz', 'it', 'means', 'that', 'the', 'CPU', 'will', 'ask', 'What', 'next', 'three', 'billion', 'times', 'per', 'second', 'You', 'are', 'going', 'to', 'have', 'to', 'learn', 'how', 'to', 'talk', 'fast', 'to', 'keep', 'up', 'with', 'the', 'CPU', 'Main', 'Memory', 'is', 'used', 'to', 'store', 'information', 'that', 'the', 'CPU', 'needs', 'in', 'a', 'hurry', 'The', 'main', 'memory', 'is', 'nearly', 'as', 'fast', 'as', 'the', 'CPU', 'But', 'the', 'information', 'stored', 'in', 'the', 'main', 'memory', 'vanishes', 'when', 'the', 'computer', 'is', 'turned', 'off', 'Secondary', 'Memory', 'is', 'also', 'used', 'to', 'store', 'information', 'but', 'it', 'is', 'much', 'slower', 'than', 'the', 'main', 'memory', 'The', 'advantage', 'of', 'the', 'secondary', 'memory', 'is', 'that', 'it', 'can', 'store', 'information', 'even', 'when', 'there', 'is', 'no', 'power', 'to', 'the', 'computer', 'Examples', 'of', 'secondary', 'memory', 'are', 'disk', 'drives', 'or', 'flash', 'memory', 'typically', 'found', 'in', 'USB', 'sticks', 'and', 'portable', 'music', 'players', 'Input', 'and', 'Output', 'Devices', 'are', 'simply', 'our', 'screen', 'keyboard', 'mouse', 'microphone', 'speaker', 'touchpad', 'etc', 'They', 'are', 'all', 'of', 'the', 'ways', 'we', 'interact', 'with', 'the', 'computer', 'These', 'days', 'most', 'computers', 'also', 'have', 'a', 'Network', 'Connection', 'to', 'retrieve', 'information', 'over', 'a', 'network', 'We', 'can', 'think', 'of', 'the', 'network', 'as', 'a', 'very', 'slow', 'place', 'to', 'store', 'and', 'retrieve', 'data', 'that', 'might', 'not', 'always', 'be', 'up', 'So', 'in', 'a', 'sense', 'the', 'network', 'is', 'a', 'slower', 'and', 'at', 'times', 'unreliable', 'form', 'of', 'Secondary', 'Memory', 'While', 'most', 'of', 'the', 'detail', 'of', 'how', 'these', 'components', 'work', 'is', 'best', 'left', 'to', 'computer', 'builders', 'it', 'helps', 'to', 'have', 'some', 'terminology', 'so', 'we', 'can', 'talk', 'about', 'these', 'different', 'parts', 'as', 'we', 'write', 'our', 'programs', 'As', 'a', 'programmer', 'your', 'job', 'is', 'to', 'use', 'and', 'orchestrate', 'each', 'of', 'these', 'resources', 'to', 'solve', 'the', 'problem', 'that', 'you', 'need', 'to', 'solve', 'and', 'analyze', 'the', 'data', 'you', 'get', 'from', 'the', 'solution', 'As', 'a', 'programmer', 'you', 'will', 'mostly', 'be', 'talking', 'to', 'the', 'CPU', 'and', 'telling', 'it', 'what', 'to', 'do', 'next', 'Sometimes', 'you', 'will', 'tell', 'the', 'CPU', 'to', 'use', 'the', 'main', 'memory', 'secondary', 'memory', 'network', 'or', 'the', 'input', 'output', 'devices', 'You', 'need', 'to', 'be', 'the', 'person', 'who', 'answers', 'the', 'CPU', 's', 'What', 'next', 'question', 'But', 'it', 'would', 'be', 'very', 'uncomfortable', 'to', 'shrink', 'you', 'down', 'to', 'five', 'mm', 'tall', 'and', 'insert', 'you', 'into', 'the', 'computer', 'just', 'so', 'you', 'could', 'issue', 'a', 'command', 'three', 'billion', 'times', 'per', 'second', 'So', 'instead', 'you', 'must', 'write', 'down', 'your', 'instructions', 'in', 'advance', 'We', 'call', 'these', 'stored', 'instructions', 'a', 'program', 'and', 'the', 'act', 'of', 'writing', 'these', 'instructions', 'down', 'and', 'getting', 'the', 'instructions', 'to', 'be', 'correct', 'programming', 'Understanding', 'programming', 'In', 'the', 'rest', 'of', 'this', 'book', 'we', 'will', 'try', 'to', 'turn', 'you', 'into', 'a', 'person', 'who', 'is', 'skilled', 'in', 'the', 'art', 'of', 'programming', 'In', 'the', 'end', 'you', 'will', 'be', 'a', 'programmer', 'perhaps', 'not', 'a', 'professional', 'programmer', 'but', 'at', 'least', 'you', 'will', 'have', 'the', 'skills', 'to', 'look', 'at', 'a', 'data', 'information', 'analysis', 'problem', 'and', 'develop', 'a', 'program', 'to', 'solve', 'the', 'problem', 'problem', 'solving', 'In', 'a', 'sense', 'you', 'need', 'two', 'skills', 'to', 'be', 'a', 'programmer', 'First', 'you', 'need', 'to', 'know', 'the', 'programming', 'language', 'Python', 'you', 'need', 'to', 'know', 'the', 'vocabulary', 'and', 'the', 'grammar', 'You', 'need', 'to', 'be', 'able', 'to', 'spell', 'the', 'words', 'in', 'this', 'new', 'language', 'properly', 'and', 'know', 'how', 'to', 'construct', 'well', 'formed', 'sentences', 'in', 'this', 'new', 'language', 'Second', 'you', 'need', 'to', 'tell', 'a', 'story', 'In', 'writing', 'a', 'story', 'you', 'combine', 'words', 'and', 'sentences', 'to', 'convey', 'an', 'idea', 'to', 'the', 'reader', 'There', 'is', 'a', 'skill', 'and', 'art', 'in', 'constructing', 'the', 'story', 'and', 'skill', 'in', 'story', 'writing', 'is', 'improved', 'by', 'doing', 'some', 'writing', 'and', 'getting', 'some', 'feedback', 'In', 'programming', 'our', 'program', 'is', 'the', 'story', 'and', 'the', 'problem', 'you', 'are', 'trying', 'to', 'solve', 'is', 'the', 'idea', 'itemize', 'Once', 'you', 'learn', 'one', 'programming', 'language', 'such', 'as', 'Python', 'you', 'will', 'find', 'it', 'much', 'easier', 'to', 'learn', 'a', 'second', 'programming', 'language', 'such', 'as', 'JavaScript', 'or', 'C', 'The', 'new', 'programming', 'language', 'has', 'very', 'different', 'vocabulary', 'and', 'grammar', 'but', 'the', 'problem', 'solving', 'skills', 'will', 'be', 'the', 'same', 'across', 'all', 'programming', 'languages', 'You', 'will', 'learn', 'the', 'vocabulary', 'and', 'sentences', 'of', 'Python', 'pretty', 'quickly', 'It', 'will', 'take', 'longer', 'for', 'you', 'to', 'be', 'able', 'to', 'write', 'a', 'coherent', 'program', 'to', 'solve', 'a', 'brand', 'new', 'problem', 'We', 'teach', 'programming', 'much', 'like', 'we', 'teach', 'writing', 'We', 'start', 'reading', 'and', 'explaining', 'programs', 'then', 'we', 'write', 'simple', 'programs', 'and', 'then', 'we', 'write', 'increasingly', 'complex', 'programs', 'over', 'time', 'At', 'some', 'point', 'you', 'get', 'your', 'muse', 'and', 'see', 'the', 'patterns', 'on', 'your', 'own', 'and', 'can', 'see', 'more', 'naturally', 'how', 'to', 'take', 'a', 'problem', 'and', 'write', 'a', 'program', 'that', 'solves', 'that', 'problem', 'And', 'once', 'you', 'get', 'to', 'that', 'point', 'programming', 'becomes', 'a', 'very', 'pleasant', 'and', 'creative', 'process', 'We', 'start', 'with', 'the', 'vocabulary', 'and', 'structure', 'of', 'Python', 'programs', 'Be', 'patient', 'as', 'the', 'simple', 'examples', 'remind', 'you', 'of', 'when', 'you', 'started', 'reading', 'for', 'the', 'first', 'time', 'Words', 'and', 'sentences', 'Unlike', 'human', 'languages', 'the', 'Python', 'vocabulary', 'is', 'actually', 'pretty', 'small', 'We', 'call', 'this', 'vocabulary', 'the', 'reserved', 'words', 'These', 'are', 'words', 'that', 'have', 'very', 'special', 'meaning', 'to', 'Python', 'When', 'Python', 'sees', 'these', 'words', 'in', 'a', 'Python', 'program', 'they', 'have', 'one', 'and', 'only', 'one', 'meaning', 'to', 'Python', 'Later', 'as', 'you', 'write', 'programs', 'you', 'will', 'make', 'up', 'your', 'own', 'words', 'that', 'have', 'meaning', 'to', 'you', 'called', 'variables', 'You', 'will', 'have', 'great', 'latitude', 'in', 'choosing', 'your', 'names', 'for', 'your', 'variables', 'but', 'you', 'cannot', 'use', 'any', 'of', 'Python', 's', 'reserved', 'words', 'as', 'a', 'name', 'for', 'a', 'variable', 'When', 'we', 'train', 'a', 'dog', 'we', 'use', 'special', 'words', 'like', 'sit', 'stay', 'and', 'fetch', 'When', 'you', 'talk', 'to', 'a', 'dog', 'and', 'don', 't', 'use', 'any', 'of', 'the', 'reserved', 'words', 'they', 'just', 'look', 'at', 'you', 'with', 'a', 'quizzical', 'look', 'on', 'their', 'face', 'until', 'you', 'say', 'a', 'reserved', 'word', 'For', 'example', 'if', 'you', 'say', 'I', 'wish', 'more', 'people', 'would', 'walk', 'to', 'improve', 'their', 'overall', 'health', 'what', 'most', 'dogs', 'likely', 'hear', 'is', 'blah', 'blah', 'blah', 'walk', 'blah', 'blah', 'blah', 'blah', 'That', 'is', 'because', 'walk', 'is', 'a', 'reserved', 'word', 'in', 'dog', 'language', 'The', 'reserved', 'words', 'in', 'the', 'language', 'where', 'humans', 'talk', 'to', 'Python', 'include', 'the', 'following', 'and', 'del', 'from', 'not', 'while', 'as', 'elif', 'global', 'or', 'with', 'assert', 'else', 'if', 'pass', 'yield', 'break', 'except', 'import', 'print', 'class', 'exec', 'in', 'raise', 'continue', 'finally', 'is', 'return', 'def', 'for', 'lambda', 'try', 'That', 'is', 'it', 'and', 'unlike', 'a', 'dog', 'Python', 'is', 'already', 'completely', 'trained', 'When', 'you', 'say', 'try', 'Python', 'will', 'try', 'every', 'time', 'you', 'say', 'it', 'without', 'fail', 'We', 'will', 'learn', 'these', 'reserved', 'words', 'and', 'how', 'they', 'are', 'used', 'in', 'good', 'time', 'but', 'for', 'now', 'we', 'will', 'focus', 'on', 'the', 'Python', 'equivalent', 'of', 'speak', 'in', 'human', 'to', 'dog', 'language', 'The', 'nice', 'thing', 'about', 'telling', 'Python', 'to', 'speak', 'is', 'that', 'we', 'can', 'even', 'tell', 'it', 'what', 'to', 'say', 'by', 'giving', 'it', 'a', 'message', 'in', 'quotes', 'And', 'we', 'have', 'even', 'written', 'our', 'first', 'syntactically', 'correct', 'Python', 'sentence', 'Our', 'sentence', 'starts', 'with', 'the', 'reserved', 'word', 'print', 'followed', 'by', 'a', 'string', 'of', 'text', 'of', 'our', 'choosing', 'enclosed', 'in', 'single', 'quotes', 'Conversing', 'with', 'Python', 'Now', 'that', 'we', 'have', 'a', 'word', 'and', 'a', 'simple', 'sentence', 'that', 'we', 'know', 'in', 'Python', 'we', 'need', 'to', 'know', 'how', 'to', 'start', 'a', 'conversation', 'with', 'Python', 'to', 'test', 'our', 'new', 'language', 'skills', 'Before', 'you', 'can', 'converse', 'with', 'Python', 'you', 'must', 'first', 'install', 'the', 'Python', 'software', 'on', 'your', 'computer', 'and', 'learn', 'how', 'to', 'start', 'Python', 'on', 'your', 'computer', 'That', 'is', 'too', 'much', 'detail', 'for', 'this', 'chapter', 'so', 'I', 'suggest', 'that', 'you', 'consult', 'www', 'py4e', 'com', 'where', 'I', 'have', 'detailed', 'instructions', 'and', 'screencasts', 'of', 'setting', 'up', 'and', 'starting', 'Python', 'on', 'Macintosh', 'and', 'Windows', 'systems', 'At', 'some', 'point', 'you', 'will', 'be', 'in', 'a', 'terminal', 'or', 'command', 'window', 'and', 'you', 'will', 'type', 'python', 'and', 'the', 'Python', 'interpreter', 'will', 'start', 'executing', 'in', 'interactive', 'mode', 'and', 'appear', 'somewhat', 'as', 'follows', 'interactive', 'mode', 'The', 'prompt', 'is', 'the', 'Python', 'interpreter', 's', 'way', 'of', 'asking', 'you', 'What', 'do', 'you', 'want', 'me', 'to', 'do', 'next', 'Python', 'is', 'ready', 'to', 'have', 'a', 'conversation', 'with', 'you', 'All', 'you', 'have', 'to', 'know', 'is', 'how', 'to', 'speak', 'the', 'Python', 'language', 'Let', 's', 'say', 'for', 'example', 'that', 'you', 'did', 'not', 'know', 'even', 'the', 'simplest', 'Python', 'language', 'words', 'or', 'sentences', 'You', 'might', 'want', 'to', 'use', 'the', 'standard', 'line', 'that', 'astronauts', 'use', 'when', 'they', 'land', 'on', 'a', 'faraway', 'planet', 'and', 'try', 'to', 'speak', 'with', 'the', 'inhabitants', 'of', 'the', 'planet', 'This', 'is', 'not', 'going', 'so', 'well', 'Unless', 'you', 'think', 'of', 'something', 'quickly', 'the', 'inhabitants', 'of', 'the', 'planet', 'are', 'likely', 'to', 'stab', 'you', 'with', 'their', 'spears', 'put', 'you', 'on', 'a', 'spit', 'roast', 'you', 'over', 'a', 'fire', 'and', 'eat', 'you', 'for', 'dinner', 'At', 'this', 'point', 'you', 'should', 'also', 'realize', 'that', 'while', 'Python', 'is', 'amazingly', 'complex', 'and', 'powerful', 'and', 'very', 'picky', 'about', 'the', 'syntax', 'you', 'use', 'to', 'communicate', 'with', 'it', 'Python', 'is', 'not', 'intelligent', 'You', 'are', 'really', 'just', 'having', 'a', 'conversation', 'with', 'yourself', 'but', 'using', 'proper', 'syntax', 'In', 'a', 'sense', 'when', 'you', 'use', 'a', 'program', 'written', 'by', 'someone', 'else', 'the', 'conversation', 'is', 'between', 'you', 'and', 'those', 'other', 'programmers', 'with', 'Python', 'acting', 'as', 'an', 'intermediary', 'Python', 'is', 'a', 'way', 'for', 'the', 'creators', 'of', 'programs', 'to', 'express', 'how', 'the', 'conversation', 'is', 'supposed', 'to', 'proceed', 'And', 'in', 'just', 'a', 'few', 'more', 'chapters', 'you', 'will', 'be', 'one', 'of', 'those', 'programmers', 'using', 'Python', 'to', 'talk', 'to', 'the', 'users', 'of', 'your', 'program', 'Before', 'we', 'leave', 'our', 'first', 'conversation', 'with', 'the', 'Python', 'interpreter', 'you', 'should', 'probably', 'know', 'the', 'proper', 'way', 'to', 'say', 'good', 'bye', 'when', 'interacting', 'with', 'the', 'inhabitants', 'of', 'Planet', 'Python', 'You', 'will', 'notice', 'that', 'the', 'error', 'is', 'different', 'for', 'the', 'first', 'two', 'incorrect', 'attempts', 'The', 'second', 'error', 'is', 'different', 'because', 'if', 'is', 'a', 'reserved', 'word', 'and', 'Python', 'saw', 'the', 'reserved', 'word', 'and', 'thought', 'we', 'were', 'trying', 'to', 'say', 'something', 'but', 'got', 'the', 'syntax', 'of', 'the', 'sentence', 'wrong', 'Terminology', 'interpreter', 'and', 'compiler', 'Python', 'is', 'a', 'high', 'level', 'language', 'intended', 'to', 'be', 'relatively', 'straightforward', 'for', 'humans', 'to', 'read', 'and', 'write', 'and', 'for', 'computers', 'to', 'read', 'and', 'process', 'Other', 'high', 'level', 'languages', 'include', 'Java', 'C', 'PHP', 'Ruby', 'Basic', 'Perl', 'JavaScript', 'and', 'many', 'more', 'The', 'actual', 'hardware', 'inside', 'the', 'Central', 'Processing', 'Unit', 'CPU', 'does', 'not', 'understand', 'any', 'of', 'these', 'high', 'level', 'languages', 'The', 'CPU', 'understands', 'a', 'language', 'we', 'call', 'machine', 'language', 'Machine', 'language', 'is', 'very', 'simple', 'and', 'frankly', 'very', 'tiresome', 'to', 'write', 'because', 'it', 'is', 'represented', 'all', 'in', 'zeros', 'and', 'ones', 'Machine', 'language', 'seems', 'quite', 'simple', 'on', 'the', 'surface', 'given', 'that', 'there', 'are', 'only', 'zeros', 'and', 'ones', 'but', 'its', 'syntax', 'is', 'even', 'more', 'complex', 'and', 'far', 'more', 'intricate', 'than', 'Python', 'So', 'very', 'few', 'programmers', 'ever', 'write', 'machine', 'language', 'Instead', 'we', 'build', 'various', 'translators', 'to', 'allow', 'programmers', 'to', 'write', 'in', 'high', 'level', 'languages', 'like', 'Python', 'or', 'JavaScript', 'and', 'these', 'translators', 'convert', 'the', 'programs', 'to', 'machine', 'language', 'for', 'actual', 'execution', 'by', 'the', 'CPU', 'Since', 'machine', 'language', 'is', 'tied', 'to', 'the', 'computer', 'hardware', 'machine', 'language', 'is', 'not', 'portable', 'across', 'different', 'types', 'of', 'hardware', 'Programs', 'written', 'in', 'high', 'level', 'languages', 'can', 'be', 'moved', 'between', 'different', 'computers', 'by', 'using', 'a', 'different', 'interpreter', 'on', 'the', 'new', 'machine', 'or', 'recompiling', 'the', 'code', 'to', 'create', 'a', 'machine', 'language', 'version', 'of', 'the', 'program', 'for', 'the', 'new', 'machine', 'These', 'programming', 'language', 'translators', 'fall', 'into', 'two', 'general', 'categories', 'one', 'interpreters', 'and', 'two', 'compilers', 'An', 'interpreter', 'reads', 'the', 'source', 'code', 'of', 'the', 'program', 'as', 'written', 'by', 'the', 'programmer', 'parses', 'the', 'source', 'code', 'and', 'interprets', 'the', 'instructions', 'on', 'the', 'fly', 'Python', 'is', 'an', 'interpreter', 'and', 'when', 'we', 'are', 'running', 'Python', 'interactively', 'we', 'can', 'type', 'a', 'line', 'of', 'Python', 'a', 'sentence', 'and', 'Python', 'processes', 'it', 'immediately', 'and', 'is', 'ready', 'for', 'us', 'to', 'type', 'another', 'line', 'of', 'Python', 'Some', 'of', 'the', 'lines', 'of', 'Python', 'tell', 'Python', 'that', 'you', 'want', 'it', 'to', 'remember', 'some', 'value', 'for', 'later', 'We', 'need', 'to', 'pick', 'a', 'name', 'for', 'that', 'value', 'to', 'be', 'remembered', 'and', 'we', 'can', 'use', 'that', 'symbolic', 'name', 'to', 'retrieve', 'the', 'value', 'later', 'We', 'use', 'the', 'term', 'variable', 'to', 'refer', 'to', 'the', 'labels', 'we', 'use', 'to', 'refer', 'to', 'this', 'stored', 'data', 'In', 'this', 'example', 'we', 'ask', 'Python', 'to', 'remember', 'the', 'value', 'six', 'and', 'use', 'the', 'label', 'x', 'so', 'we', 'can', 'retrieve', 'the', 'value', 'later', 'We', 'verify', 'that', 'Python', 'has', 'actually', 'remembered', 'the', 'value', 'using', 'x', 'and', 'multiply', 'it', 'by', 'seven', 'and', 'put', 'the', 'newly', 'computed', 'value', 'in', 'y', 'Then', 'we', 'ask', 'Python', 'to', 'print', 'out', 'the', 'value', 'currently', 'in', 'y', 'Even', 'though', 'we', 'are', 'typing', 'these', 'commands', 'into', 'Python', 'one', 'line', 'at', 'a', 'time', 'Python', 'is', 'treating', 'them', 'as', 'an', 'ordered', 'sequence', 'of', 'statements', 'with', 'later', 'statements', 'able', 'to', 'retrieve', 'data', 'created', 'in', 'earlier', 'statements', 'We', 'are', 'writing', 'our', 'first', 'simple', 'paragraph', 'with', 'four', 'sentences', 'in', 'a', 'logical', 'and', 'meaningful', 'order', 'It', 'is', 'the', 'nature', 'of', 'an', 'interpreter', 'to', 'be', 'able', 'to', 'have', 'an', 'interactive', 'conversation', 'as', 'shown', 'above', 'A', 'compiler', 'needs', 'to', 'be', 'handed', 'the', 'entire', 'program', 'in', 'a', 'file', 'and', 'then', 'it', 'runs', 'a', 'process', 'to', 'translate', 'the', 'high', 'level', 'source', 'code', 'into', 'machine', 'language', 'and', 'then', 'the', 'compiler', 'puts', 'the', 'resulting', 'machine', 'language', 'into', 'a', 'file', 'for', 'later', 'If', 'you', 'have', 'a', 'Windows', 'system', 'often', 'these', 'executable', 'machine', 'language', 'programs', 'have', 'a', 'suffix', 'of', 'exe', 'or', 'dll', 'which', 'stand', 'for', 'executable', 'and', 'dynamic', 'link', 'library', 'respectively', 'In', 'Linux', 'and', 'Macintosh', 'there', 'is', 'no', 'suffix', 'that', 'uniquely', 'marks', 'a', 'file', 'as', 'executable', 'If', 'you', 'were', 'to', 'open', 'an', 'executable', 'file', 'in', 'a', 'text', 'editor', 'it', 'would', 'look', 'completely', 'crazy', 'and', 'be', 'unreadable', 'It', 'is', 'not', 'easy', 'to', 'read', 'or', 'write', 'machine', 'language', 'so', 'it', 'is', 'nice', 'that', 'we', 'have', 'compilers', 'that', 'allow', 'us', 'to', 'write', 'in', 'high', 'level', 'languages', 'like', 'Python', 'or', 'C', 'Now', 'at', 'this', 'point', 'in', 'our', 'discussion', 'of', 'compilers', 'and', 'interpreters', 'you', 'should', 'be', 'wondering', 'a', 'bit', 'about', 'the', 'Python', 'interpreter', 'itself', 'What', 'language', 'is', 'it', 'written', 'in', 'Is', 'it', 'written', 'in', 'a', 'compiled', 'language', 'When', 'we', 'type', 'python', 'what', 'exactly', 'is', 'happening', 'The', 'Python', 'interpreter', 'is', 'written', 'in', 'a', 'high', 'level', 'language', 'called', 'C', 'You', 'can', 'look', 'at', 'the', 'actual', 'source', 'code', 'for', 'the', 'Python', 'interpreter', 'by', 'going', 'to', 'www', 'python', 'org', 'and', 'working', 'your', 'way', 'to', 'their', 'source', 'code', 'So', 'Python', 'is', 'a', 'program', 'itself', 'and', 'it', 'is', 'compiled', 'into', 'machine', 'code', 'When', 'you', 'installed', 'Python', 'on', 'your', 'computer', 'or', 'the', 'vendor', 'installed', 'it', 'you', 'copied', 'a', 'machine', 'code', 'copy', 'of', 'the', 'translated', 'Python', 'program', 'onto', 'your', 'system', 'In', 'Windows', 'the', 'executable', 'machine', 'code', 'for', 'Python', 'itself', 'is', 'likely', 'in', 'a', 'file', 'That', 'is', 'more', 'than', 'you', 'really', 'need', 'to', 'know', 'to', 'be', 'a', 'Python', 'programmer', 'but', 'sometimes', 'it', 'pays', 'to', 'answer', 'those', 'little', 'nagging', 'questions', 'right', 'at', 'the', 'beginning', 'Writing', 'a', 'program', 'Typing', 'commands', 'into', 'the', 'Python', 'interpreter', 'is', 'a', 'great', 'way', 'to', 'experiment', 'with', 'Python', 's', 'features', 'but', 'it', 'is', 'not', 'recommended', 'for', 'solving', 'more', 'complex', 'problems', 'When', 'we', 'want', 'to', 'write', 'a', 'program', 'we', 'use', 'a', 'text', 'editor', 'to', 'write', 'the', 'Python', 'instructions', 'into', 'a', 'file', 'which', 'is', 'called', 'a', 'script', 'By', 'convention', 'Python', 'scripts', 'have', 'names', 'that', 'end', 'with', 'py', 'script', 'To', 'execute', 'the', 'script', 'you', 'have', 'to', 'tell', 'the', 'Python', 'interpreter', 'the', 'name', 'of', 'the', 'file', 'In', 'a', 'Unix', 'or', 'Windows', 'command', 'window', 'you', 'would', 'type', 'python', 'hello', 'py', 'as', 'follows', 'We', 'call', 'the', 'Python', 'interpreter', 'and', 'tell', 'it', 'to', 'read', 'its', 'source', 'code', 'from', 'the', 'file', 'hello', 'py', 'instead', 'of', 'prompting', 'us', 'for', 'lines', 'of', 'Python', 'code', 'interactively', 'You', 'will', 'notice', 'that', 'there', 'was', 'no', 'need', 'to', 'have', 'quit', 'at', 'the', 'end', 'of', 'the', 'Python', 'program', 'in', 'the', 'file', 'When', 'Python', 'is', 'reading', 'your', 'source', 'code', 'from', 'a', 'file', 'it', 'knows', 'to', 'stop', 'when', 'it', 'reaches', 'the', 'end', 'of', 'the', 'file', 'What', 'is', 'a', 'program', 'The', 'definition', 'of', 'a', 'program', 'at', 'its', 'most', 'basic', 'is', 'a', 'sequence', 'of', 'Python', 'statements', 'that', 'have', 'been', 'crafted', 'to', 'do', 'something', 'Even', 'our', 'simple', 'hello', 'py', 'script', 'is', 'a', 'program', 'It', 'is', 'a', 'one', 'line', 'program', 'and', 'is', 'not', 'particularly', 'useful', 'but', 'in', 'the', 'strictest', 'definition', 'it', 'is', 'a', 'Python', 'program', 'It', 'might', 'be', 'easiest', 'to', 'understand', 'what', 'a', 'program', 'is', 'by', 'thinking', 'about', 'a', 'problem', 'that', 'a', 'program', 'might', 'be', 'built', 'to', 'solve', 'and', 'then', 'looking', 'at', 'a', 'program', 'that', 'would', 'solve', 'that', 'problem', 'Lets', 'say', 'you', 'are', 'doing', 'Social', 'Computing', 'research', 'on', 'Facebook', 'posts', 'and', 'you', 'are', 'interested', 'in', 'the', 'most', 'frequently', 'used', 'word', 'in', 'a', 'series', 'of', 'posts', 'You', 'could', 'print', 'out', 'the', 'stream', 'of', 'Facebook', 'posts', 'and', 'pore', 'over', 'the', 'text', 'looking', 'for', 'the', 'most', 'common', 'word', 'but', 'that', 'would', 'take', 'a', 'long', 'time', 'and', 'be', 'very', 'mistake', 'prone', 'You', 'would', 'be', 'smart', 'to', 'write', 'a', 'Python', 'program', 'to', 'handle', 'the', 'task', 'quickly', 'and', 'accurately', 'so', 'you', 'can', 'spend', 'the', 'weekend', 'doing', 'something', 'fun', 'For', 'example', 'look', 'at', 'the', 'following', 'text', 'about', 'a', 'clown', 'and', 'a', 'car', 'Look', 'at', 'the', 'text', 'and', 'figure', 'out', 'the', 'most', 'common', 'word', 'and', 'how', 'many', 'times', 'it', 'occurs', 'Then', 'imagine', 'that', 'you', 'are', 'doing', 'this', 'task', 'looking', 'at', 'millions', 'of', 'lines', 'of', 'text', 'Frankly', 'it', 'would', 'be', 'quicker', 'for', 'you', 'to', 'learn', 'Python', 'and', 'write', 'a', 'Python', 'program', 'to', 'count', 'the', 'words', 'than', 'it', 'would', 'be', 'to', 'manually', 'scan', 'the', 'words', 'The', 'even', 'better', 'news', 'is', 'that', 'I', 'already', 'came', 'up', 'with', 'a', 'simple', 'program', 'to', 'find', 'the', 'most', 'common', 'word', 'in', 'a', 'text', 'file', 'I', 'wrote', 'it', 'tested', 'it', 'and', 'now', 'I', 'am', 'giving', 'it', 'to', 'you', 'to', 'use', 'so', 'you', 'can', 'save', 'some', 'time', 'You', 'don', 't', 'even', 'need', 'to', 'know', 'Python', 'to', 'use', 'this', 'program', 'You', 'will', 'need', 'to', 'get', 'through', 'Chapter', 'ten', 'of', 'this', 'book', 'to', 'fully', 'understand', 'the', 'awesome', 'Python', 'techniques', 'that', 'were', 'used', 'to', 'make', 'the', 'program', 'You', 'are', 'the', 'end', 'user', 'you', 'simply', 'use', 'the', 'program', 'and', 'marvel', 'at', 'its', 'cleverness', 'and', 'how', 'it', 'saved', 'you', 'so', 'much', 'manual', 'effort', 'You', 'simply', 'type', 'the', 'code', 'into', 'a', 'file', 'called', 'words', 'py', 'and', 'run', 'it', 'or', 'you', 'download', 'the', 'source', 'code', 'from', 'http', 'www', 'py4e', 'com', 'code3', 'and', 'run', 'it', 'This', 'is', 'a', 'good', 'example', 'of', 'how', 'Python', 'and', 'the', 'Python', 'language', 'are', 'acting', 'as', 'an', 'intermediary', 'between', 'you', 'the', 'end', 'user', 'and', 'me', 'the', 'programmer', 'Python', 'is', 'a', 'way', 'for', 'us', 'to', 'exchange', 'useful', 'instruction', 'sequences', 'i', 'e', 'programs', 'in', 'a', 'common', 'language', 'that', 'can', 'be', 'used', 'by', 'anyone', 'who', 'installs', 'Python', 'on', 'their', 'computer', 'So', 'neither', 'of', 'us', 'are', 'talking', 'to', 'Python', 'instead', 'we', 'are', 'communicating', 'with', 'each', 'other', 'through', 'Python', 'The', 'building', 'blocks', 'of', 'programs', 'In', 'the', 'next', 'few', 'chapters', 'we', 'will', 'learn', 'more', 'about', 'the', 'vocabulary', 'sentence', 'structure', 'paragraph', 'structure', 'and', 'story', 'structure', 'of', 'Python', 'We', 'will', 'learn', 'about', 'the', 'powerful', 'capabilities', 'of', 'Python', 'and', 'how', 'to', 'compose', 'those', 'capabilities', 'together', 'to', 'create', 'useful', 'programs', 'There', 'are', 'some', 'low', 'level', 'conceptual', 'patterns', 'that', 'we', 'use', 'to', 'construct', 'programs', 'These', 'constructs', 'are', 'not', 'just', 'for', 'Python', 'programs', 'they', 'are', 'part', 'of', 'every', 'programming', 'language', 'from', 'machine', 'language', 'up', 'to', 'the', 'high', 'level', 'languages', 'description', 'Get', 'data', 'from', 'the', 'outside', 'world', 'This', 'might', 'be', 'reading', 'data', 'from', 'a', 'file', 'or', 'even', 'some', 'kind', 'of', 'sensor', 'like', 'a', 'microphone', 'or', 'GPS', 'In', 'our', 'initial', 'programs', 'our', 'input', 'will', 'come', 'from', 'the', 'user', 'typing', 'data', 'on', 'the', 'keyboard', 'Display', 'the', 'results', 'of', 'the', 'program', 'on', 'a', 'screen', 'or', 'store', 'them', 'in', 'a', 'file', 'or', 'perhaps', 'write', 'them', 'to', 'a', 'device', 'like', 'a', 'speaker', 'to', 'play', 'music', 'or', 'speak', 'text', 'Perform', 'statements', 'one', 'after', 'another', 'in', 'the', 'order', 'they', 'are', 'encountered', 'in', 'the', 'script', 'Check', 'for', 'certain', 'conditions', 'and', 'then', 'execute', 'or', 'skip', 'a', 'sequence', 'of', 'statements', 'Perform', 'some', 'set', 'of', 'statements', 'repeatedly', 'usually', 'with', 'some', 'variation', 'Write', 'a', 'set', 'of', 'instructions', 'once', 'and', 'give', 'them', 'a', 'name', 'and', 'then', 'reuse', 'those', 'instructions', 'as', 'needed', 'throughout', 'your', 'program', 'description', 'It', 'sounds', 'almost', 'too', 'simple', 'to', 'be', 'true', 'and', 'of', 'course', 'it', 'is', 'never', 'so', 'simple', 'It', 'is', 'like', 'saying', 'that', 'walking', 'is', 'simply', 'putting', 'one', 'foot', 'in', 'front', 'of', 'the', 'other', 'The', 'art', 'of', 'writing', 'a', 'program', 'is', 'composing', 'and', 'weaving', 'these', 'basic', 'elements', 'together', 'many', 'times', 'over', 'to', 'produce', 'something', 'that', 'is', 'useful', 'to', 'its', 'users', 'The', 'word', 'counting', 'program', 'above', 'directly', 'uses', 'all', 'of', 'these', 'patterns', 'except', 'for', 'one', 'What', 'could', 'possibly', 'go', 'wrong', 'As', 'we', 'saw', 'in', 'our', 'earliest', 'conversations', 'with', 'Python', 'we', 'must', 'communicate', 'very', 'precisely', 'when', 'we', 'write', 'Python', 'code', 'The', 'smallest', 'deviation', 'or', 'mistake', 'will', 'cause', 'Python', 'to', 'give', 'up', 'looking', 'at', 'your', 'program', 'Beginning', 'programmers', 'often', 'take', 'the', 'fact', 'that', 'Python', 'leaves', 'no', 'room', 'for', 'errors', 'as', 'evidence', 'that', 'Python', 'is', 'mean', 'hateful', 'and', 'cruel', 'While', 'Python', 'seems', 'to', 'like', 'everyone', 'else', 'Python', 'knows', 'them', 'personally', 'and', 'holds', 'a', 'grudge', 'against', 'them', 'Because', 'of', 'this', 'grudge', 'Python', 'takes', 'our', 'perfectly', 'written', 'programs', 'and', 'rejects', 'them', 'as', 'unfit', 'just', 'to', 'torment', 'us', 'There', 'is', 'little', 'to', 'be', 'gained', 'by', 'arguing', 'with', 'Python', 'It', 'is', 'just', 'a', 'tool', 'It', 'has', 'no', 'emotions', 'and', 'it', 'is', 'happy', 'and', 'ready', 'to', 'serve', 'you', 'whenever', 'you', 'need', 'it', 'Its', 'error', 'messages', 'sound', 'harsh', 'but', 'they', 'are', 'just', 'Python', 's', 'call', 'for', 'help', 'It', 'has', 'looked', 'at', 'what', 'you', 'typed', 'and', 'it', 'simply', 'cannot', 'understand', 'what', 'you', 'have', 'entered', 'Python', 'is', 'much', 'more', 'like', 'a', 'dog', 'loving', 'you', 'unconditionally', 'having', 'a', 'few', 'key', 'words', 'that', 'it', 'understands', 'looking', 'you', 'with', 'a', 'sweet', 'look', 'on', 'its', 'face', 'and', 'waiting', 'for', 'you', 'to', 'say', 'something', 'it', 'understands', 'When', 'Python', 'says', 'SyntaxError', 'invalid', 'syntax', 'it', 'is', 'simply', 'wagging', 'its', 'tail', 'and', 'saying', 'You', 'seemed', 'to', 'say', 'something', 'but', 'I', 'just', 'don', 't', 'understand', 'what', 'you', 'meant', 'but', 'please', 'keep', 'talking', 'to', 'me', 'As', 'your', 'programs', 'become', 'increasingly', 'sophisticated', 'you', 'will', 'encounter', 'three', 'general', 'types', 'of', 'errors', 'description', 'These', 'are', 'the', 'first', 'errors', 'you', 'will', 'make', 'and', 'the', 'easiest', 'to', 'fix', 'A', 'syntax', 'error', 'means', 'that', 'you', 'have', 'violated', 'the', 'grammar', 'rules', 'of', 'Python', 'Python', 'does', 'its', 'best', 'to', 'point', 'right', 'at', 'the', 'line', 'and', 'character', 'where', 'it', 'noticed', 'it', 'was', 'confused', 'The', 'only', 'tricky', 'bit', 'of', 'syntax', 'errors', 'is', 'that', 'sometimes', 'the', 'mistake', 'that', 'needs', 'fixing', 'is', 'actually', 'earlier', 'in', 'the', 'program', 'than', 'where', 'Python', 'noticed', 'it', 'was', 'confused', 'So', 'the', 'line', 'and', 'character', 'that', 'Python', 'indicates', 'in', 'a', 'syntax', 'error', 'may', 'just', 'be', 'a', 'starting', 'point', 'for', 'your', 'investigation', 'A', 'logic', 'error', 'is', 'when', 'your', 'program', 'has', 'good', 'syntax', 'but', 'there', 'is', 'a', 'mistake', 'in', 'the', 'order', 'of', 'the', 'statements', 'or', 'perhaps', 'a', 'mistake', 'in', 'how', 'the', 'statements', 'relate', 'to', 'one', 'another', 'A', 'good', 'example', 'of', 'a', 'logic', 'error', 'might', 'be', 'take', 'a', 'drink', 'from', 'your', 'water', 'bottle', 'put', 'it', 'in', 'your', 'backpack', 'walk', 'to', 'the', 'library', 'and', 'then', 'put', 'the', 'top', 'back', 'on', 'the', 'bottle', 'A', 'semantic', 'error', 'is', 'when', 'your', 'description', 'of', 'the', 'steps', 'to', 'take', 'is', 'syntactically', 'perfect', 'and', 'in', 'the', 'right', 'order', 'but', 'there', 'is', 'simply', 'a', 'mistake', 'in', 'the', 'program', 'The', 'program', 'is', 'perfectly', 'correct', 'but', 'it', 'does', 'not', 'do', 'what', 'you', 'intended', 'for', 'it', 'to', 'do', 'A', 'simple', 'example', 'would', 'be', 'if', 'you', 'were', 'giving', 'a', 'person', 'directions', 'to', 'a', 'restaurant', 'and', 'said', 'when', 'you', 'reach', 'the', 'intersection', 'with', 'the', 'gas', 'station', 'turn', 'left', 'and', 'go', 'one', 'mile', 'and', 'the', 'restaurant', 'is', 'a', 'red', 'building', 'on', 'your', 'left', 'Your', 'friend', 'is', 'very', 'late', 'and', 'calls', 'you', 'to', 'tell', 'you', 'that', 'they', 'are', 'on', 'a', 'farm', 'and', 'walking', 'around', 'behind', 'a', 'barn', 'with', 'no', 'sign', 'of', 'a', 'restaurant', 'Then', 'you', 'say', 'did', 'you', 'turn', 'left', 'or', 'right', 'at', 'the', 'gas', 'station', 'and', 'they', 'say', 'I', 'followed', 'your', 'directions', 'perfectly', 'I', 'have', 'them', 'written', 'down', 'it', 'says', 'turn', 'left', 'and', 'go', 'one', 'mile', 'at', 'the', 'gas', 'station', 'Then', 'you', 'say', 'I', 'am', 'very', 'sorry', 'because', 'while', 'my', 'instructions', 'were', 'syntactically', 'correct', 'they', 'sadly', 'contained', 'a', 'small', 'but', 'undetected', 'semantic', 'error', 'description', 'Again', 'in', 'all', 'three', 'types', 'of', 'errors', 'Python', 'is', 'merely', 'trying', 'its', 'hardest', 'to', 'do', 'exactly', 'what', 'you', 'have', 'asked', 'The', 'learning', 'journey', 'As', 'you', 'progress', 'through', 'the', 'rest', 'of', 'the', 'book', 'don', 't', 'be', 'afraid', 'if', 'the', 'concepts', 'don', 't', 'seem', 'to', 'fit', 'together', 'well', 'the', 'first', 'time', 'When', 'you', 'were', 'learning', 'to', 'speak', 'it', 'was', 'not', 'a', 'problem', 'for', 'your', 'first', 'few', 'years', 'that', 'you', 'just', 'made', 'cute', 'gurgling', 'noises', 'And', 'it', 'was', 'OK', 'if', 'it', 'took', 'six', 'months', 'for', 'you', 'to', 'move', 'from', 'simple', 'vocabulary', 'to', 'simple', 'sentences', 'and', 'took', 'five', 'or', 'six', 'more', 'years', 'to', 'move', 'from', 'sentences', 'to', 'paragraphs', 'and', 'a', 'few', 'more', 'years', 'to', 'be', 'able', 'to', 'write', 'an', 'interesting', 'complete', 'short', 'story', 'on', 'your', 'own', 'We', 'want', 'you', 'to', 'learn', 'Python', 'much', 'more', 'rapidly', 'so', 'we', 'teach', 'it', 'all', 'at', 'the', 'same', 'time', 'over', 'the', 'next', 'few', 'chapters', 'But', 'it', 'is', 'like', 'learning', 'a', 'new', 'language', 'that', 'takes', 'time', 'to', 'absorb', 'and', 'understand', 'before', 'it', 'feels', 'natural', 'That', 'leads', 'to', 'some', 'confusion', 'as', 'we', 'visit', 'and', 'revisit', 'topics', 'to', 'try', 'to', 'get', 'you', 'to', 'see', 'the', 'big', 'picture', 'while', 'we', 'are', 'defining', 'the', 'tiny', 'fragments', 'that', 'make', 'up', 'that', 'big', 'picture', 'While', 'the', 'book', 'is', 'written', 'linearly', 'and', 'if', 'you', 'are', 'taking', 'a', 'course', 'it', 'will', 'progress', 'in', 'a', 'linear', 'fashion', 'don', 't', 'hesitate', 'to', 'be', 'very', 'nonlinear', 'in', 'how', 'you', 'approach', 'the', 'material', 'Look', 'forwards', 'and', 'backwards', 'and', 'read', 'with', 'a', 'light', 'touch', 'By', 'skimming', 'more', 'advanced', 'material', 'without', 'fully', 'understanding', 'the', 'details', 'you', 'can', 'get', 'a', 'better', 'understanding', 'of', 'the', 'why', 'of', 'programming', 'By', 'reviewing', 'previous', 'material', 'and', 'even', 'redoing', 'earlier', 'exercises', 'you', 'will', 'realize', 'that', 'you', 'actually', 'learned', 'a', 'lot', 'of', 'material', 'even', 'if', 'the', 'material', 'you', 'are', 'currently', 'staring', 'at', 'seems', 'a', 'bit', 'impenetrable', 'Usually', 'when', 'you', 'are', 'learning', 'your', 'first', 'programming', 'language', 'there', 'are', 'a', 'few', 'wonderful', 'Ah', 'Hah', 'moments', 'where', 'you', 'can', 'look', 'up', 'from', 'pounding', 'away', 'at', 'some', 'rock', 'with', 'a', 'hammer', 'and', 'chisel', 'and', 'step', 'away', 'and', 'see', 'that', 'you', 'are', 'indeed', 'building', 'a', 'beautiful', 'sculpture', 'If', 'something', 'seems', 'particularly', 'hard', 'there', 'is', 'usually', 'no', 'value', 'in', 'staying', 'up', 'all', 'night', 'and', 'staring', 'at', 'it', 'Take', 'a', 'break', 'take', 'a', 'nap', 'have', 'a', 'snack', 'explain', 'what', 'you', 'are', 'having', 'a', 'problem', 'with', 'to', 'someone', 'or', 'perhaps', 'your', 'dog', 'and', 'then', 'come', 'back', 'to', 'it', 'with', 'fresh', 'eyes', 'I', 'assure', 'you', 'that', 'once', 'you', 'learn', 'the', 'programming', 'concepts', 'in', 'the', 'book', 'you', 'will', 'look', 'back', 'and', 'see', 'that', 'it', 'was', 'all', 'really', 'easy', 'and', 'elegant', 'and', 'it', 'simply', 'took', 'you', 'a', 'bit', 'of', 'time', 'to', 'absorb', 'it', 'The', 'end']
[4692, 5503, 2628, 4182, 3975, 83, 5847, 627, 3303, 2435, 3866, 686, 646, 6108, 1599, 1712, 1841, 6986, 3539, 7080, 8423, 6307, 323, 1040, 787, 3831, 5598, 5233, 9627, 631, 7, 3998, 7337, 6785, 2411, 1135, 4, 5785, 5995, 5886, 864, 7365, 4662, 7166, 4760, 9971, 9649, 6544, 557, 5540, 7936, 6591, 584, 3295, 343, 3727, 2007, 8142, 6131, 9205, 9234, 7069, 5276, 8856, 940, 9176, 6951, 6466, 1049, 1123, 5656, 9361, 6157, 4, 3, 42]
{4692: 1, 5503: 1, 2628: 1, 4182: 1, 3975: 1, 83: 1, 5847: 1, 627: 1, 3303: 1, 2435: 1, 3866: 1, 686: 1, 646: 1, 6108: 1, 1599: 1, 1712: 1, 1841: 1, 6986: 1, 3539: 1, 7080: 1, 8423: 1, 6307: 1, 323: 1, 1040: 1, 787: 1, 3831: 1, 5598: 1, 5233: 1, 9627: 1, 631: 1, 7: 1, 3998: 1, 7337: 1, 6785: 1, 2411: 1, 1135: 1, 4: 2, 5785: 1, 5995: 1, 5886: 1, 864: 1, 7365: 1, 4662: 1, 7166: 1, 4760: 1, 9971: 1, 9649: 1, 6544: 1, 557: 1, 5540: 1, 7936: 1, 6591: 1, 584: 1, 3295: 1, 343: 1, 3727: 1, 2007: 1, 8142: 1, 6131: 1, 9205: 1, 9234: 1, 7069: 1, 5276: 1, 8856: 1, 940: 1, 9176: 1, 6951: 1, 6466: 1, 1049: 1, 1123: 1, 5656: 1, 9361: 1, 6157: 1, 3: 1, 42: 1}
{'This': 6, 'file': 16, 'contains': 2, 'the': 230, 'actual': 4, 'data': 11, 'for': 48, 'your': 38, 'assignment': 1, 'good': 7, 'luck': 1, 'Why': 1, 'should': 4, 'you': 133, 'learn': 14, 'to': 205, 'write': 22, 'programs': 25, 'Writing': 2, 'or': 29, 'programming': 19, 'is': 113, 'a': 166, 'very': 20, 'creative': 5, 'and': 160, 'rewarding': 2, 'activity': 2, 'You': 19, 'can': 22, 'many': 10, 'reasons': 1, 'ranging': 2, 'from': 17, 'making': 1, 'living': 1, 'solving': 4, 'difficult': 1, 'analysis': 3, 'problem': 16, 'having': 4, 'fun': 2, 'helping': 2, 'someone': 3, 'else': 4, 'solve': 9, 'book': 7, 'assumes': 1, 'that': 68, 'everyone': 2, 'needs': 5, 'know': 12, 'how': 20, 'program': 41, 'once': 4, 'will': 34, 'figure': 3, 'out': 4, 'what': 14, 'want': 6, 'do': 15, 'with': 37, 'newfound': 1, 'skills': 5, 'We': 16, 'are': 43, 'surrounded': 1, 'in': 68, 'our': 22, 'daily': 1, 'lives': 2, 'computers': 11, 'laptops': 1, 'cell': 1, 'phones': 1, 'think': 4, 'of': 103, 'these': 14, 'as': 25, 'personal': 2, 'assistants': 1, 'who': 4, 'take': 8, 'care': 1, 'things': 6, 'on': 23, 'behalf': 2, 'The': 21, 'hardware': 6, 'current': 1, 'day': 1, 'essentially': 1, 'built': 4, 'continuously': 1, 'ask': 4, 'us': 11, 'question': 2, 'What': 7, 'would': 12, 'like': 12, 'me': 5, 'next': 9, 'Programmers': 1, 'add': 1, 'an': 10, 'operating': 1, 'system': 3, 'set': 3, 'applications': 1, 'we': 51, 'end': 10, 'up': 11, 'Personal': 2, 'Digital': 2, 'Assistant': 2, 'quite': 2, 'helpful': 2, 'capable': 1, 'different': 10, 'Our': 3, 'fast': 3, 'have': 27, 'vast': 1, 'amounts': 1, 'memory': 9, 'could': 5, 'be': 41, 'if': 9, 'only': 4, 'knew': 2, 'language': 41, 'speak': 8, 'explain': 2, 'computer': 20, 'it': 66, 'If': 6, 'this': 19, 'tell': 9, 'tasks': 2, 'were': 8, 'repetitive': 1, 'Interestingly': 1, 'kinds': 2, 'best': 4, 'often': 3, 'humans': 4, 'find': 3, 'boring': 1, 'mind': 1, 'numbing': 1, 'For': 5, 'example': 8, 'look': 10, 'at': 28, 'first': 13, 'three': 7, 'paragraphs': 3, 'chapter': 3, 'most': 10, 'commonly': 1, 'used': 11, 'word': 15, 'times': 8, 'While': 5, 'able': 6, 'read': 6, 'understand': 7, 'words': 18, 'few': 9, 'seconds': 1, 'counting': 3, 'them': 9, 'almost': 2, 'painful': 1, 'because': 6, 'not': 18, 'kind': 2, 'human': 3, 'minds': 1, 'designed': 1, 'opposite': 1, 'true': 2, 'reading': 5, 'understanding': 3, 'text': 10, 'piece': 2, 'paper': 1, 'hard': 2, 'but': 21, 'telling': 3, 'was': 8, 'easy': 3, 'information': 8, 'assistant': 1, 'quickly': 4, 'told': 1, 'sixteen': 1, 'fact': 2, 'why': 2, 'need': 16, 'become': 2, 'skilled': 2, 'talking': 4, 'Once': 2, 'new': 9, 'delegate': 1, 'mundane': 1, 'partner': 1, 'leaving': 1, 'more': 18, 'time': 12, 'uniquely': 2, 'suited': 1, 'bring': 1, 'creativity': 1, 'intuition': 1, 'inventiveness': 1, 'partnership': 1, 'Creativity': 1, 'motivation': 2, 'intended': 3, 'professional': 3, 'programmers': 9, 'job': 2, 'both': 2, 'financially': 1, 'personally': 2, 'Building': 1, 'useful': 5, 'elegant': 2, 'clever': 1, 'others': 2, 'use': 19, 'Your': 2, 'PDA': 2, 'usually': 3, 'groups': 2, 'each': 3, 'competing': 1, 'attention': 1, 'interest': 1, 'They': 2, 'try': 7, 'their': 6, 'meet': 1, 'give': 4, 'great': 3, 'user': 5, 'experience': 1, 'process': 4, 'In': 13, 'some': 14, 'situations': 1, 'when': 14, 'choose': 1, 'software': 3, 'directly': 2, 'compensated': 1, 'choice': 1, 'output': 2, 'perhaps': 5, 'following': 3, 'sensible': 1, 'version': 2, 'now': 3, 'primary': 1, 'make': 5, 'money': 1, 'please': 2, 'users': 3, 'instead': 4, 'productive': 1, 'handling': 1, 'encounter': 2, 'When': 11, 'start': 7, 'programmer': 10, 'As': 6, 'gain': 1, 'skill': 3, 'feels': 2, 'thoughts': 1, 'may': 2, 'turn': 5, 'toward': 1, 'developing': 1, 'Computer': 1, 'architecture': 1, 'Before': 3, 'learning': 5, 'instructions': 11, 'develop': 2, 'small': 3, 'amount': 1, 'about': 9, 'Central': 2, 'Processing': 2, 'Unit': 2, 'CPU': 11, 'part': 2, 'obsessed': 1, 'rated': 1, 'Gigahertz': 1, 'means': 2, 'billion': 2, 'per': 2, 'second': 4, 'going': 3, 'talk': 5, 'keep': 2, 'Main': 1, 'Memory': 3, 'store': 5, 'hurry': 1, 'main': 4, 'nearly': 1, 'But': 3, 'stored': 3, 'vanishes': 1, 'turned': 1, 'off': 1, 'Secondary': 2, 'also': 3, 'much': 7, 'slower': 2, 'than': 5, 'advantage': 1, 'secondary': 3, 'even': 10, 'there': 8, 'no': 7, 'power': 1, 'Examples': 1, 'disk': 1, 'drives': 1, 'flash': 1, 'typically': 1, 'found': 1, 'USB': 1, 'sticks': 1, 'portable': 2, 'music': 2, 'players': 1, 'Input': 1, 'Output': 1, 'Devices': 1, 'simply': 8, 'screen': 2, 'keyboard': 2, 'mouse': 1, 'microphone': 2, 'speaker': 2, 'touchpad': 1, 'etc': 1, 'all': 8, 'ways': 1, 'interact': 1, 'These': 5, 'days': 1, 'Network': 1, 'Connection': 1, 'retrieve': 5, 'over': 6, 'network': 4, 'slow': 1, 'place': 1, 'might': 6, 'always': 1, 'So': 6, 'sense': 3, 'unreliable': 1, 'form': 1, 'detail': 2, 'components': 1, 'work': 1, 'left': 5, 'builders': 1, 'helps': 1, 'terminology': 1, 'so': 11, 'parts': 1, 'orchestrate': 1, 'resources': 1, 'analyze': 1, 'get': 6, 'solution': 1, 'mostly': 1, 'Sometimes': 1, 'input': 2, 'devices': 1, 'person': 3, 'answers': 1, 's': 6, 'uncomfortable': 1, 'shrink': 1, 'down': 4, 'five': 2, 'mm': 1, 'tall': 1, 'insert': 1, 'into': 10, 'just': 11, 'issue': 1, 'command': 3, 'must': 3, 'advance': 1, 'call': 5, 'act': 1, 'writing': 7, 'getting': 2, 'correct': 4, 'Understanding': 1, 'rest': 2, 'art': 3, 'least': 1, 'two': 4, 'First': 1, 'Python': 103, 'vocabulary': 8, 'grammar': 3, 'spell': 1, 'properly': 1, 'construct': 2, 'well': 3, 'formed': 1, 'sentences': 8, 'Second': 1, 'story': 7, 'combine': 1, 'convey': 1, 'idea': 2, 'reader': 1, 'There': 3, 'constructing': 1, 'improved': 1, 'by': 12, 'doing': 4, 'feedback': 1, 'trying': 3, 'itemize': 1, 'one': 13, 'such': 2, 'easier': 1, 'JavaScript': 3, 'C': 4, 'has': 5, 'same': 2, 'across': 2, 'languages': 8, 'pretty': 2, 'It': 10, 'longer': 1, 'coherent': 1, 'brand': 1, 'teach': 3, 'explaining': 1, 'then': 9, 'simple': 13, 'increasingly': 2, 'complex': 4, 'At': 3, 'point': 7, 'muse': 1, 'see': 5, 'patterns': 3, 'own': 3, 'naturally': 1, 'solves': 1, 'And': 4, 'becomes': 1, 'pleasant': 1, 'structure': 4, 'Be': 1, 'patient': 1, 'examples': 1, 'remind': 1, 'started': 1, 'Words': 1, 'Unlike': 1, 'actually': 4, 'reserved': 10, 'special': 2, 'meaning': 3, 'sees': 1, 'they': 10, 'Later': 1, 'called': 4, 'variables': 2, 'latitude': 1, 'choosing': 2, 'names': 2, 'cannot': 2, 'any': 3, 'name': 5, 'variable': 2, 'train': 1, 'dog': 7, 'sit': 1, 'stay': 1, 'fetch': 1, 'don': 6, 't': 6, 'quizzical': 1, 'face': 2, 'until': 1, 'say': 14, 'I': 11, 'wish': 1, 'people': 1, 'walk': 4, 'improve': 1, 'overall': 1, 'health': 1, 'dogs': 1, 'likely': 3, 'hear': 1, 'blah': 7, 'That': 5, 'where': 5, 'include': 2, 'del': 1, 'while': 4, 'elif': 1, 'global': 1, 'assert': 1, 'pass': 1, 'yield': 1, 'break': 2, 'except': 2, 'import': 1, 'print': 4, 'class': 1, 'exec': 1, 'raise': 1, 'continue': 1, 'finally': 1, 'return': 1, 'def': 1, 'lambda': 1, 'unlike': 1, 'already': 2, 'completely': 2, 'trained': 1, 'every': 2, 'without': 2, 'fail': 1, 'focus': 1, 'equivalent': 1, 'nice': 2, 'thing': 1, 'giving': 3, 'message': 1, 'quotes': 2, 'written': 10, 'syntactically': 3, 'sentence': 6, 'starts': 1, 'followed': 2, 'string': 1, 'enclosed': 1, 'single': 1, 'Conversing': 1, 'Now': 2, 'conversation': 7, 'test': 1, 'converse': 1, 'install': 1, 'too': 2, 'suggest': 1, 'consult': 1, 'www': 3, 'py4e': 2, 'com': 2, 'detailed': 1, 'screencasts': 1, 'setting': 1, 'starting': 2, 'Macintosh': 2, 'Windows': 4, 'systems': 1, 'terminal': 1, 'window': 2, 'type': 6, 'python': 4, 'interpreter': 14, 'executing': 1, 'interactive': 3, 'mode': 2, 'appear': 1, 'somewhat': 1, 'follows': 2, 'prompt': 1, 'way': 6, 'asking': 1, 'ready': 3, 'All': 1, 'Let': 1, 'did': 2, 'simplest': 1, 'standard': 1, 'line': 7, 'astronauts': 1, 'land': 1, 'faraway': 1, 'planet': 3, 'inhabitants': 3, 'Unless': 1, 'something': 8, 'stab': 1, 'spears': 1, 'put': 4, 'spit': 1, 'roast': 1, 'fire': 1, 'eat': 1, 'dinner': 1, 'realize': 2, 'amazingly': 1, 'powerful': 2, 'picky': 1, 'syntax': 9, 'communicate': 2, 'intelligent': 1, 'really': 3, 'yourself': 1, 'using': 4, 'proper': 2, 'between': 3, 'those': 5, 'other': 3, 'acting': 2, 'intermediary': 2, 'creators': 1, 'express': 1, 'supposed': 1, 'proceed': 1, 'chapters': 3, 'leave': 1, 'probably': 1, 'bye': 1, 'interacting': 1, 'Planet': 1, 'notice': 2, 'error': 9, 'incorrect': 1, 'attempts': 1, 'saw': 2, 'thought': 1, 'got': 1, 'wrong': 2, 'Terminology': 1, 'compiler': 3, 'high': 9, 'level': 10, 'relatively': 1, 'straightforward': 1, 'Other': 1, 'Java': 1, 'PHP': 1, 'Ruby': 1, 'Basic': 1, 'Perl': 1, 'inside': 1, 'does': 3, 'understands': 3, 'machine': 16, 'Machine': 2, 'frankly': 1, 'tiresome': 1, 'represented': 1, 'zeros': 2, 'ones': 2, 'seems': 4, 'surface': 1, 'given': 1, 'its': 9, 'far': 1, 'intricate': 1, 'ever': 1, 'Instead': 1, 'build': 1, 'various': 1, 'translators': 3, 'allow': 2, 'convert': 1, 'execution': 1, 'Since': 1, 'tied': 1, 'types': 3, 'Programs': 1, 'moved': 1, 'recompiling': 1, 'code': 15, 'create': 2, 'fall': 1, 'general': 2, 'categories': 1, 'interpreters': 2, 'compilers': 3, 'An': 1, 'reads': 1, 'source': 8, 'parses': 1, 'interprets': 1, 'fly': 1, 'running': 1, 'interactively': 2, 'processes': 1, 'immediately': 1, 'another': 3, 'Some': 1, 'lines': 3, 'remember': 2, 'value': 9, 'later': 5, 'pick': 1, 'remembered': 2, 'symbolic': 1, 'term': 1, 'refer': 2, 'labels': 1, 'six': 3, 'label': 1, 'x': 2, 'verify': 1, 'multiply': 1, 'seven': 1, 'newly': 1, 'computed': 1, 'y': 2, 'Then': 4, 'currently': 2, 'Even': 2, 'though': 1, 'typing': 2, 'commands': 2, 'treating': 1, 'ordered': 1, 'sequence': 3, 'statements': 9, 'created': 1, 'earlier': 3, 'paragraph': 2, 'four': 1, 'logical': 1, 'meaningful': 1, 'order': 4, 'nature': 1, 'shown': 1, 'above': 2, 'A': 6, 'handed': 1, 'entire': 1, 'runs': 1, 'translate': 1, 'puts': 1, 'resulting': 1, 'executable': 5, 'suffix': 2, 'exe': 1, 'dll': 1, 'which': 2, 'stand': 1, 'dynamic': 1, 'link': 1, 'library': 2, 'respectively': 1, 'Linux': 1, 'marks': 1, 'open': 1, 'editor': 2, 'crazy': 1, 'unreadable': 1, 'discussion': 1, 'wondering': 1, 'bit': 4, 'itself': 3, 'Is': 1, 'compiled': 2, 'exactly': 2, 'happening': 1, 'org': 1, 'working': 1, 'installed': 2, 'vendor': 1, 'copied': 1, 'copy': 1, 'translated': 1, 'onto': 1, 'sometimes': 2, 'pays': 1, 'answer': 1, 'little': 2, 'nagging': 1, 'questions': 1, 'right': 4, 'beginning': 1, 'Typing': 1, 'experiment': 1, 'features': 1, 'recommended': 1, 'problems': 1, 'script': 5, 'By': 3, 'convention': 1, 'scripts': 1, 'py': 5, 'To': 1, 'execute': 2, 'Unix': 1, 'hello': 3, 'prompting': 1, 'quit': 1, 'knows': 2, 'stop': 1, 'reaches': 1, 'definition': 2, 'basic': 2, 'been': 1, 'crafted': 1, 'particularly': 2, 'strictest': 1, 'easiest': 2, 'thinking': 1, 'looking': 5, 'Lets': 1, 'Social': 1, 'Computing': 1, 'research': 1, 'Facebook': 2, 'posts': 3, 'interested': 1, 'frequently': 1, 'series': 1, 'stream': 1, 'pore': 1, 'common': 4, 'long': 1, 'mistake': 6, 'prone': 1, 'smart': 1, 'handle': 1, 'task': 2, 'accurately': 1, 'spend': 1, 'weekend': 1, 'clown': 1, 'car': 1, 'Look': 2, 'occurs': 1, 'imagine': 1, 'millions': 1, 'Frankly': 1, 'quicker': 1, 'count': 1, 'manually': 1, 'scan': 1, 'better': 2, 'news': 1, 'came': 1, 'wrote': 1, 'tested': 1, 'am': 2, 'save': 1, 'through': 3, 'Chapter': 1, 'ten': 1, 'fully': 2, 'awesome': 1, 'techniques': 1, 'marvel': 1, 'cleverness': 1, 'saved': 1, 'manual': 1, 'effort': 1, 'run': 2, 'download': 1, 'http': 1, 'code3': 1, 'exchange': 1, 'instruction': 1, 'sequences': 1, 'i': 1, 'e': 1, 'anyone': 1, 'installs': 1, 'neither': 1, 'communicating': 1, 'building': 3, 'blocks': 1, 'capabilities': 2, 'compose': 1, 'together': 3, 'low': 1, 'conceptual': 1, 'constructs': 1, 'description': 5, 'Get': 1, 'outside': 1, 'world': 1, 'sensor': 1, 'GPS': 1, 'initial': 1, 'come': 2, 'Display': 1, 'results': 1, 'device': 1, 'play': 1, 'Perform': 2, 'after': 1, 'encountered': 1, 'Check': 1, 'certain': 1, 'conditions': 1, 'skip': 1, 'repeatedly': 1, 'variation': 1, 'Write': 1, 'reuse': 1, 'needed': 1, 'throughout': 1, 'sounds': 1, 'course': 2, 'never': 1, 'saying': 2, 'walking': 2, 'putting': 1, 'foot': 1, 'front': 1, 'composing': 1, 'weaving': 1, 'elements': 1, 'produce': 1, 'uses': 1, 'possibly': 1, 'go': 3, 'earliest': 1, 'conversations': 1, 'precisely': 1, 'smallest': 1, 'deviation': 1, 'cause': 1, 'Beginning': 1, 'leaves': 1, 'room': 1, 'errors': 5, 'evidence': 1, 'mean': 1, 'hateful': 1, 'cruel': 1, 'holds': 1, 'grudge': 2, 'against': 1, 'Because': 1, 'takes': 2, 'perfectly': 3, 'rejects': 1, 'unfit': 1, 'torment': 1, 'gained': 1, 'arguing': 1, 'tool': 1, 'emotions': 1, 'happy': 1, 'serve': 1, 'whenever': 1, 'Its': 1, 'messages': 1, 'sound': 1, 'harsh': 1, 'help': 1, 'looked': 1, 'typed': 1, 'entered': 1, 'loving': 1, 'unconditionally': 1, 'key': 1, 'sweet': 1, 'waiting': 1, 'says': 2, 'SyntaxError': 1, 'invalid': 1, 'wagging': 1, 'tail': 1, 'seemed': 1, 'meant': 1, 'sophisticated': 1, 'fix': 1, 'violated': 1, 'rules': 1, 'character': 2, 'noticed': 2, 'confused': 2, 'tricky': 1, 'fixing': 1, 'indicates': 1, 'investigation': 1, 'logic': 2, 'relate': 1, 'drink': 1, 'water': 1, 'bottle': 2, 'backpack': 1, 'top': 1, 'back': 3, 'semantic': 2, 'steps': 1, 'perfect': 1, 'directions': 2, 'restaurant': 3, 'said': 1, 'reach': 1, 'intersection': 1, 'gas': 3, 'station': 3, 'mile': 2, 'red': 1, 'friend': 1, 'late': 1, 'calls': 1, 'farm': 1, 'around': 1, 'behind': 1, 'barn': 1, 'sign': 1, 'sorry': 1, 'my': 1, 'sadly': 1, 'contained': 1, 'undetected': 1, 'Again': 1, 'merely': 1, 'hardest': 1, 'asked': 1, 'journey': 1, 'progress': 2, 'afraid': 1, 'concepts': 2, 'seem': 1, 'fit': 1, 'years': 3, 'made': 1, 'cute': 1, 'gurgling': 1, 'noises': 1, 'OK': 1, 'took': 3, 'months': 1, 'move': 2, 'interesting': 1, 'complete': 1, 'short': 1, 'rapidly': 1, 'absorb': 2, 'before': 1, 'natural': 1, 'leads': 1, 'confusion': 1, 'visit': 1, 'revisit': 1, 'topics': 1, 'big': 2, 'picture': 2, 'defining': 1, 'tiny': 1, 'fragments': 1, 'linearly': 1, 'taking': 1, 'linear': 1, 'fashion': 1, 'hesitate': 1, 'nonlinear': 1, 'approach': 1, 'material': 5, 'forwards': 1, 'backwards': 1, 'light': 1, 'touch': 1, 'skimming': 1, 'advanced': 1, 'details': 1, 'reviewing': 1, 'previous': 1, 'redoing': 1, 'exercises': 1, 'learned': 1, 'lot': 1, 'staring': 2, 'impenetrable': 1, 'Usually': 1, 'wonderful': 1, 'Ah': 1, 'Hah': 1, 'moments': 1, 'pounding': 1, 'away': 2, 'rock': 1, 'hammer': 1, 'chisel': 1, 'step': 1, 'indeed': 1, 'beautiful': 1, 'sculpture': 1, 'staying': 1, 'night': 1, 'Take': 1, 'nap': 1, 'snack': 1, 'fresh': 1, 'eyes': 1, 'assure': 1}
​
Enter fullscreen mode Exit fullscreen mode

Day 21 of #100Daysofcode and #Python
* Try to learned more about Regular expression
* Try to write my own project in basic CSS
* Written a simple class to read local file find numbers, words, occurrence of numbers and words. pic.twitter.com/18rWl5IlbW

— Durga Pokharel (@mathdurga) January 14, 2021

Top comments (0)