Filter By
Filter Reset
Exam Types
  • All Exams
  • Final (22)
  • Midterm (2)
Semester
Study Guides (330,171)
CA (146,888)
WLU (5,475)
CP (165)
CP104 (24)

Study Guides for CP104 at Wilfrid Laurier University

Introduction to Programming

Exam Study Guides for CP104

Covers all exam topics.

CP104 Study Guide - Final Guide: Butterscotch
Premium

Final Exam practice Question 1(zero_init) def zero_init(wholelist): for i in range (len(wholelist)): for c in range(len(wholelist[0])): wholelist[i].pop(c) wholelist[i].insert(c,0) retu...

Computer Science
CP104
Safaa Bedawi
CP104- Final Exam Guide - Comprehensive Notes for the exam ( 82 pages long!)

[CP104] Comprehensive spring guide including any lecture notes, textbook notes and exam guides.find more resources at oneclass.com Comments â€ÃÂ...

Computer Science
CP104
Allison Mc Donald
CP104 Final: Resetting the Turtle

Resetting the Turtles Window The turtle.reset() statement: Erases all drawings that currently appear in the graphics window. Resets the drawing color to black. Resets the turtle to its original position in the center of th...

Computer Science
CP104
Allison Mc Donald
CP104 Study Guide - Final Guide: Turtle Graphics

Named Constants You should use named constants instead of magic numbers. A named constant is a name that represents a value that does not change during the programs execution. Example: INTEREST_RATE = 0.069 This creates a ...

Computer Science
CP104
Allison Mc Donald
CP104 Study Guide - Final Guide: The Turtles

Moving the Turtle Forward Use the turtle.forward(n) statement to move the turtle forward n pixels. >>> import turtle >>> turtle.forward(100)

Computer Science
CP104
Allison Mc Donald
CP104 Study Guide - Final Guide: Turtle Graphics

Hiding and Displaying the Turtle Use the turtle.hideturtle() command to hide the turtle. This command does not change the way graphics are drawn, it simply hides the turtle icon. Use the turtle.showturtle() command to disp...

Computer Science
CP104
Allison Mc Donald
CP104 Study Guide - Final Guide: Printf Format String, Scientific Notation

Formatting Numbers Can format display of numbers on screen using builtin format function Two arguments: Numeric value to be formatted Format specifier Returns string containing formatted number Format specifier typically i...

Computer Science
CP104
Allison Mc Donald
CP104 Final: Drawing Circles

Drawing Circles Use the turtle.circle(radius) statement to draw a circle with a specified radius >>> turtle.circle(100) Drawing Dots

Computer Science
CP104
Allison Mc Donald
CP104 Study Guide - Final Guide: Decimal Mark

Variable Reassignment Variables can reference different values while program is running Garbage collection: removal of values that are no longer referenced by variables Carried out by Python interpreter A variable can refe...

Computer Science
CP104
Allison Mc Donald
CP104 Study Guide - Final Guide: Type Conversion, Data Type

The Exponent Operator and the Remainder Operator Exponent operator (**): Raises a number to a power x ** y = x y Remainder operator (): Performs division and returns the remainder a.k.a. modulus operator e.g., 42=0, 52=1

Computer Science
CP104
Allison Mc Donald
CP104 Study Guide - Final Guide: Exponentiation, Type Conversion, Nested Function

Reading Numbers with the input Function input function always returns a string Builtin functions convert between data types int(item) converts item to an int float(item) converts item to a float Nested function call: gener...

Computer Science
CP104
Allison Mc Donald
CP104 Study Guide - Final Guide: Data General

Comments Comments: notes of explanation within a program Ignored by Python interpreter programs codea person reading the Begin with a character Endline comment: appears at the end of a line of code

Computer Science
CP104
Allison Mc Donald
CP104 Study Guide - Final Guide: String Literal, Concatenation, Tab Key

Breaking Long Statements into Multiple Lines Long statements cannot be viewed on screen without scrolling and cannot be printed without cutting off Multiline continuation character (): Allows to break a statement into mult...

Computer Science
CP104
Allison Mc Donald
CP104 Study Guide - Final Guide: String Literal

Function to determine Factorial of a number def factorial(n): if n == 0: return 1 else: return n * factorial(n 1) print(factorial(6)) Mathematical Functions, multiply or power import math def f1(a): a = a*10 return a def ...

Computer Science
CP104
Allison Mc Donald

Log In


OR

Don't have an account?

Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Sign up

Join to view


OR

By registering, I agree to the Terms and Privacy Policies
Already have an account?
Just a few more details

So we can recommend you notes for your school.

Reset Password

Please enter below the email address you registered with and we will send you a link to reset your password.

Add your courses

Get notes from the top students in your class.


Submit