Sequences: Strings, Lists, and Files
Sequences: Strings, Lists, and Files
1
Objectives
? To understand the string data type and how strings are represented in the computer.
? To be familiar with various operations that can be performed on strings through built-in functions and the string library.
2
The String Data Type
? The most common use of personal computers is word processing. ? Text is represented in programs by the string data type. ? A string is a sequence of characters enclosed within quotation marks
(") or apostrophes (').
3
The String Data Type
>>> str1="Hello" >>> str2=`Spring' >>> print(str1, str2) Hello Spring >>> type(str1) >>> type(str2)
4
The String Data Type
? Getting a string as input
>>> firstName = input("Please enter your name: ") Please enter your name: John >>> print("Hello", firstName) Hello John
? Notice that the input is not evaluated. We want to store the typed characters, not to evaluate them as a Python expression.
5
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- ppyytthhoonn ssttrriinnggss tutorialspoint
- strings in python cs department
- strings ncert
- strings in python marquette university
- numbers strings and lists purdue university
- python strings methods
- numbers strings and lists
- sequences strings lists and files
- lists and strings calvin university
- strings lists sets dictionaries and files 4 1 strings
Related searches
- arithmetic and geometric sequences worksheet
- sequences and series practice problems
- arithmetic and geometric sequences answers
- arithmetic and geometric sequences examples
- number patterns and sequences worksheet
- sequences and series test pdf
- arithmetic sequences and series pdf
- arithmetic and geometric sequences quiz
- patterns and arithmetic sequences quizlet
- home organization lists and charts
- arithmetic and geometric sequences test
- arithmetic and geometric sequences pdf