Submission of Assignment 02

Hello,

import inquisition
FISHY = inquisition.SPANISH.replace('surprise', 'haddock')
ONE_FISH = 'Spanish'
TWO_FISH = len(ONE_FISH)
SPANISH_FISHY = FISHY.index(ONE_FISH)
RED_FISH = FISHY[:SPANISH_FISHY]
BLUE_FISH = FISHY[SPANISH_FISHY + TWO_FISH:]
FLEMISH_INQUISITION = RED_FISH + 'Flemish' + BLUE_FISH

Is this more what you had in mind?

From: Chad Heuschober [mailto:notifications@github.com]
Sent: Monday, September 8, 2014 4:31 PM
To: is210-2014-fall-02/is210_lesson_02
Cc: kevin.doles@spsmail.cuny.edu
Subject: Re: [is210_lesson_02] Submission of Assignment 02 (#10)


In flemish.py:

> @@ -0,0 +1,11 @@

> +#!/usr/bin/env python

> +# -*- coding: utf-8 -*-

> +"""Contains expectations."""

> +

> +

> +import inquisition

> +FISHY = inquisition.SPANISH.replace('surprise', 'haddock')

> +ONE_FISH = 'Spanish'

> +TWO_FISH = len(ONE_FISH)

> +SPANISH_FISHY = FISHY.index(ONE_FISH, 0, len(FISHY))

> +FLEMISH_INQUISITION = FISHY[:19] + 'Flemish' + FISHY[26:]

You got a good start here, though you ultimately weren't able to get it all the way. We want to replace that hard-coding of FISHY[:19] and FISHY[26:]. Are there ways you could calculate the 19 and 26 so they could act as variables instead?

Think this through, In SPANISH_FISHY you know where the word Spanish starts in FISHY. Since it's the start of Spanish it's also the end of the first half of the string. If you print it's value (print SPANISH_FISHY) I think it'll make a bit more sense.

Now, for replacing the other side is fairly similar. If SPANISH_FISHY is the start of the replacement string, how could you use that and another variable (you've already calculated!), to come up with the start of the second half of the string (replacing 26) ?

—
Reply to this email directly or view it on GitHub<https://github.com/is210-2014-fall-02/is210_lesson_02/pull/10/files#r17264715>.