More about Strings

[Pages:109]+

Introduction to String Manipulation

Introduction to Programming - Python

+ Agenda ? Week of 3/29

Day 17

n Midterm Exam Grades and Midterm Grades - EOW

n Reading ? Gaddis, Chapter 8

n Self-Paced Learning Module #8 & Quiz #8

n Lecture:

n String Basics n String Indexing n String Functions & Methods n Slicing and Operators

+

Midterm Exam Grades

+ Midterm Exam Grade Distribution

Brightspace Computation

+

More about Strings ...

+ What is a String?

n A String is a data type in the Python programming language n A String can be described as a "sequence of characters" n Characters are arranged in a particular position in a String.

For example: word1 ="hello" n In this String the character 'h' is the first character in the String, followed by 'e', etc. The following String contains the same characters but they are arranged in a different position: word2 = "loleh"

+ Review: String Concatenation

mystr = 'yes' mystr += 'no' mystr += 'yes' print(mystr) # what gets printed?

+

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download