Thursday, December 11, 2014

Activity 1.3.5

Activity 1.3.5 






What the code is doing is it's checking whether or not the sentence you enter meets the requirements. If it did not then it would give you messages saying what was wrong with it. (As shown in lines 4,6, and 8.)

1.       How many characters are in this sentence? Does it matter whether Python is storing the string as one byte per character or four bytes per character?

       40 characters are in the first sentence. I counted.  yes because it needs to be one byte so something like "taco" isnt 16 bytes.

2.   This question asks you about something you have not learned. In fact, the question is asking about details that go beyond what you will learn in this course. However, wondering what is going on at a lower level of abstraction – and talking about it – can be a useful strategy when learning about computing.

      Describe what you think occurs in memory when the following code is executed.

      In []: a = 'one string'
In []: b = 'another'
In []: c = a[:3] + ' and ' + b
In []: print(c[6:10])

         nd an is what is printed.