sampleMT2011 - Eng1D04 Sample Test Date McMaster University...

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

View Full Document Right Arrow Icon
Eng1D04 Sample Test Date Duration: minutes McMaster University (CAS) Instructor: Dr. Asghar A. Bokhari Student Name: ID: This test paper includes 7 pages and 15 questions. You are responsible for ensuring that your copy of the test is complete. Bring any discrepancy to the attention of your invigilator. Special Instructions : 1. No calculators, cell phones or other memory aids of any kind are allowed. 2. No course notes, solution manuals, books or other loose papers are allowed. 3. Attempt to answer every question. 4. The mark weighting for each question is given within the square brackets. 5. Use a pencil to mark your answers on the optical scanning sheet. 6. Make sure your name and student number are on both the question paper and the optical scanning sheet. “Bubble-in” your student number. 7. Make sure you hand in both the question paper and the optical scanning sheet. You will not receive a grade if both papers are not handed in. continued on page 2
Background image of page 1

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

View Full DocumentRight Arrow Icon
Page 2 of 7 Question 1 [1] What are the values of x, y and z after the following code executes: x = 3 y = 5 z = 9 y = x x = y y = z z = x x = y y = y A. x = 5, y = 9, z = 3. B. x = 5, y = 3, z = 3. C. x = 9, y = 9, z = 5. D. x = 9, y = 9, z = 3. (= ANS E. x = 5, y = 9, z = 9. Question 2 [2] Consider the following Python code for copying a slice, from m to n, of sequence y to the corresponding locations in sequence x. That is, after the code executes the sequences in the slices x[m:n] and y[m:n] will be equivalent. You should assume that 0 < m < len(x), 0 < n < len(x) and len(x) = len(y). for i in range (m, n):
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 7

sampleMT2011 - Eng1D04 Sample Test Date McMaster University...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online