Intro to Computer Science CS1510, Section 2 Dr. Sarah Diesburg

Slides:



Advertisements
Similar presentations
General Computer Science for Engineers CISC 106 Lecture 19 Dr. John Cavazos Computer and Information Sciences 04/06/2009.
Advertisements

More on Functions (Part 2) Intro to Computer Science CS1510, Section 2 Dr. Sarah Diesburg.
Lab 07: Caesar Cypher Intro to Computer Science CS1510, Section 2 Dr. Sarah Diesburg.
Intro to Nested Looping Intro to Computer Science CS1510 Dr. Sarah Diesburg.
Exam Prep and Wrap-Up Intro to Computer Science CS1510, Section 2 Dr. Sarah Diesburg.
Introduction to Strings Intro to Computer Science CS1510, Section 2 Dr. Sarah Diesburg 1.
ITEC 109 Lecture 11 While loops. while loops Review Choices –1 st –2 nd to ?th –Last What happens if you only use ifs? Can you have just an else by itself?
Midterm Review Important control structures Functions Loops Conditionals Important things to review Binary Boolean operators (and, or, not) Libraries (import.
Chapter 3 Decisions Three control structures Algorithms Pseudocode Flowcharts If…then …else Nested if statements Code blocks { } multi statement blocks.
Midterm Exam Topics (Prof. Chang's section) CMSC 201.
Repetition Intro to Computer Science CS1510 Dr. Sarah Diesburg.
More on Functions (Part 2) Intro to Computer Science CS1510, Section 2 Dr. Sarah Diesburg.
CMSC201 Computer Science I for Majors Lecture 07 – While Loops
CSS 290: Video Games and Computer Programming
More on Functions (Part 2)
CompSci 101 Introduction to Computer Science
CMSC201 Computer Science I for Majors Lecture 13 – Midterm Review
Making Choices with if Statements
Introduction To Repetition The for loop
CMSC201 Computer Science I for Majors Lecture 13 – Midterm Review
Intro to Computer Science CS1510, Section 2 Dr. Sarah Diesburg
CompSci 101 Introduction to Computer Science
Intro to Computer Science CS1510 Dr. Sarah Diesburg
CMSC201 Computer Science I for Majors Lecture 27 – Final Exam Review
Chapter 8 Namespaces and Memory Realities
Topics discussed in this section:
Intro to Computer Science CS1510, Section 2 Dr. Sarah Diesburg
Exam II Summary EE 457, April 14, 2015 Dr. McCalley.
Intro to Computer Science CS1510 Dr. Sarah Diesburg
Intro to Computer Science CS1510 Dr. Sarah Diesburg
Last Class We Covered Data representation Binary numbers ASCII values
More Nested Loops and Lab 5
Intro to Computer Science CS1510 Dr. Sarah Diesburg
Lists – Indexing and Sorting
Intro to Nested Looping
Types, Truth, and Expressions (Part 2)
String Encodings and Penny Math
Types, Truth, and Expressions (Part 2)
Intro to Nested Looping
Types, Truth, and Expressions (Part 2)
Types, Truth, and Expressions (Part 2)
Intro to Computer Science CS1510
Thinking about Strings
Intro to Computer Science CS1510 Dr. Sarah Diesburg
Intro to Computer Science CS1510, Section 2 Dr. Sarah Diesburg
Logical Operations In Matlab.
Intro to Computer Science CS1510 Dr. Sarah Diesburg
Intro to Computer Science CS1510, Section 2 Dr. Sarah Diesburg
Intro to Computer Science CS1510 Dr. Sarah Diesburg
CMSC201 Computer Science I for Majors Lecture 25 – Final Exam Review
More on Functions (Part 2)
More on Functions (Part 2)
Lists – Indexing and Sorting
Intro to Nested Looping
Types, Truth, and Expressions (Part 2)
Intro to Computer Science CS1510 Dr. Sarah Diesburg
Intro to Computer Science CS1510 Dr. Sarah Diesburg
Chapter 8 Namespaces and Memory Realities
Intro to Computer Science CS1510, Section 2 Dr. Sarah Diesburg
Intro to Computer Science CS1510, Section 2 Dr. Sarah Diesburg
Midterm Review October 23, 2006 ComS 207: Programming I (in Java)
Introduction to Strings
Introduction to Computer Science
Lists – Indexing and Sorting
String Encodings and Penny Math
Intro to Computer Science CS1510 Dr. Sarah Diesburg
Types, Truth, and Expressions
Introduction to Strings
Intro to Computer Science CS1510 Dr. Sarah Diesburg
Types, Truth, and Expressions (Part 2)
Presentation transcript:

Intro to Computer Science CS1510, Section 2 Dr. Sarah Diesburg Exam Prep and Wrap-Up Intro to Computer Science CS1510, Section 2 Dr. Sarah Diesburg

Topics for today Information on the exams Several examples from your book Some string formatting examples

Exam Information Two exams next week Focuses on chapters 0-4 Includes material from the lectures and from the readings.

Exam Information Wednesday In class, written exam Mixture of multiple choice, short answer, and essay. 100 points Closed book, closed notes

Exam Information Thursday In lab, programming exam Five small scripts 125 points (25 points each) Closed book, MOSTLY closed notes One page (one sided) of handwritten notes May also use the built in Python documentation (really not helpful if you haven’t used it before then)

Advice for the Tests These things can make the difference of whether you pass or fail this class when studying Go through each class days notes and example programs on the website Practice coding over and over by going through your labs!!! This is the only way to really learn. Review vocabulary and concepts by reading the book!!

Again… The only way you can become comfortable with a toolset is to practice Understanding what a power drill does will not help you much if you don’t practice using it It’s the same for code Practicing coding will make you more familiar with the coding structures necessary to code more quickly Patterns will emerge, it will become easier

Review Wrap-Up Find a Letter Error Checking Nested Loops DeMorgan’s Law Using and/or/not correctly

4.1 Find a Letter river = 'Mississippi' target = input('Input character to find: ') found = False for index in range(len(river)): #for each index if river[index] == target: #check print( "Letter found at index: ", index ) found = True break # stop searching if (found == False) print( 'Letter',target,'not found in',river)

Examples

Enumerate Function The enumerate function prints out two values: the index of an element and the element itself Can use it to iterate through both the index and element simultaneously, doing dual assignment

4.2-4.3 Enumeration # print first occurrence river = 'Mississippi' target = input('Input character to find: ') for index,letter in enumerate(river): if letter== target: #check print ("Letter found at index: ", index) break # stop searching else: print( 'Letter',target,'not found in',river)

4.2-4.3 Enumeration # print all occurrences river = 'Mississippi' target = input('Input character to find: ') for index,letter in enumerate(river): if letter== target: #check print ("Letter found at index: ", index ) # break # stop else: print( 'Letter',target,'not found in',river)