Thinking about Strings

Slides:



Advertisements
Similar presentations
Sequences and Summations
Advertisements

Lab 07: Caesar Cypher Intro to Computer Science CS1510, Section 2 Dr. Sarah Diesburg.
Lists and Tuples Intro to Computer Science CS1510 Dr. Sarah Diesburg.
Numerical Representation Intro to Computer Science CS1510, Section 2 Dr. Sarah Diesburg 1.
Lab 07: Caesar Cypher Intro to Computer Science CS1510, Section 2 Dr. Sarah Diesburg.
Sequences and Summations Section 2.4. Section Summary Sequences. – Examples: Geometric Progression, Arithmetic Progression Recurrence Relations – Example:
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.
Tuples and Dictionaries Intro to Computer Science CS1510, Section 2 Dr. Sarah Diesburg.
Introduction to Files Intro to Computer Science CS1510, Section 2 Dr. Sarah Diesburg 1.
Problem Solving Intro to Computer Science CS1510 Dr. Sarah Diesburg 1.
String and Lists Dr. José M. Reyes Álamo. 2 Outline What is a string String operations Traversing strings String slices What is a list Traversing a list.
Numerical Representation Intro to Computer Science CS1510 Dr. Sarah Diesburg 1.
Numerical Representation
Intro to Computer Science CS1510, Section 2 Dr. Sarah Diesburg
Intro to CS Nov 13, 2017.
Intro to Computer Science CS1510 Dr. Sarah Diesburg
Thinking about programming
Intro to Computer Science CS1510 Dr. Sarah Diesburg
Intro to Computer Science CS1510, Section 2 Dr. Sarah Diesburg
More Repetition While and For Loops Sentinel-Controlled Loops
Intro to Computer Science CS1510 Dr. Sarah Diesburg
Introduction to Strings
Introduction to Strings
Numerical Representation
Intro to Computer Science CS1510 Dr. Sarah Diesburg
Intro to Computer Science CS1510 Dr. Sarah Diesburg
More Nested Loops and Lab 5
Lists – Indexing and Sorting
Creation, Traversal, Insertion and Removal
Types, Truth, and Expressions (Part 2)
String Encodings and Penny Math
Intro to Computer Science CS1510 Dr. Sarah Diesburg
Intro to Nested Looping
Intro to Computer Science CS1510 Dr. Sarah Diesburg
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
Intro to Computer Science CS1510, Section 2 Dr. Sarah Diesburg
Intro to Computer Science CS1510 Dr. Sarah Diesburg
Digital Encodings.
Lists – Indexing and Sorting
Numerical Representation
Intro to Computer Science CS1510, Section 2 Dr. Sarah Diesburg
Introduction to Strings
More Repetition While and For loop variations
Intro to Computer Science CS1510 Dr. Sarah Diesburg
CS1110 Today: collections.
Intro to Computer Science CS1510 Dr. Sarah Diesburg
Intro to Computer Science CS1510 Dr. Sarah Diesburg
Intro to Computer Science CS1510 Dr. Sarah Diesburg
Intro to Computer Science CS1510 Dr. Sarah Diesburg
Thinking about programming
Intro to Computer Science CS1510 Dr. Sarah Diesburg
Introduction to Computer Science
Thinking about programming
Intro to Computer Science CS1510 Dr. Sarah Diesburg
Intro to Computer Science CS1510, Section 2 Dr. Sarah Diesburg
Introduction to Strings
Intro to Computer Science CS1510 Dr. Sarah Diesburg
String Encodings and Penny Math
Intro to Computer Science CS1510 Dr. Sarah Diesburg
Types, Truth, and Expressions
CS2911 Week 3, Lab Today Thursday Friday Review Muddiest Point Lab 3
Intro to Computer Science CS1510 Dr. Sarah Diesburg
Introduction to Strings
Course A201: Introduction to Programming
Intro to Computer Science CS1510 Dr. Sarah Diesburg
Numerical Representation
Presentation transcript:

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

What are strings? Sequences of characters We will often work with sequences of data String is just a specific example We will see many of the things we do with strings later on with other sequences of data

Sequences of data Can work with size of sequence Can work with individual pieces of information in the sequence

Thought Exercise Suppose I give you a string >>> mesg = “Today is Friday” What is the length of that string?

Thought Exercise >>> mesg = “Today is Friday” mesg[1]

Note about Answers >>> msg[3:9] Answer is ay is But how do we write this to show spaces? On answer sheets or tests, be very careful If I can’t tell that there are spaces, I might take points off

Questions so far?

Let’s talk about the lab Sequences, indexes, and slicing. Reversing the Str Working backwards and appending Working forwards and prepending Counting the vowels Handling both cases Using methods and handling only one case