CMPT 120 LECTURE MIDTERM 2 SOLUTIONS

Def copys result for a in s result result a return

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: What does the acronym "OOPL" stand for? _Object Oriented Programming Language _ page 2 2. Programming (30-points) 11. Write the function, copy(s) which returns a new string with the same characters as string s. def copy(s): result = "" for a in s: result = result + a return result 12. Write the function, equals(x1, x2), where both x1 and x2 are lists. Remember that two lists are equal if they are the same length and have the same corresponding elements. Return True if the lists are equal and False otherwise. Make sure the function works...
View Full Document

This document was uploaded on 03/18/2014 for the course CMPT 120 at Simon Fraser.

Ask a homework question - tutors are online