{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

20099_t2 - CSC 108H1 F 2009 Test 2 Duration 35 minutes Aids...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
CSC 108H1 F 2009 Test 2 Duration — 35 minutes Aids allowed: none Student Number: Last Name: First Name: Lecture Section: L0101 Instructor: Horton Do not turn this page until you have received the signal to start. (Please fill out the identification section above, write your name on the back of the test , and read the instructions below.) Good Luck! This midterm consists of 2 questions on 8 pages (including this one). When you receive the signal to start, please make sure that your copy is complete. Comments and docstrings are not required except where indicated, although they may help us mark your answers. They may also get you part marks if you can’t figure out how to write the code. No error checking is required: assume all user input and all argument values are valid. If you use any space for rough work, indicate clearly what you want marked. # 1: /10 # 2: /10 TOTAL : /20 Total Pages = 8 Page 1 cont’d . . .
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
CSC 108H1 F Test 2 Fall 2009 Question 1. [10 marks] For the purpose of this question, we will consider the letters“a”, “e”, “i”, “o” and “u” (whether lowercase or uppercase) to be vowels, but not ”y”. Part (a) [4 marks] Consider the following function: def vowels(s, i): ’’’Return the length of the longest sequence of consecutive vowels within s that starts at index i. s is a str of length at least one, and i is a valid index into s.’’’ Complete the table below by adding four distinct test cases for function vowels . For each, provide specific
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern