Python 2, Introduction
Printable Version (pdf)
Course Introduction
Python is a language with a simple syntax, and a powerful set of libraries. It is an interpreted language, with a rich programming environment, including a robust debugger and profiler. While it is easy for beginners to learn, it is widely used in many scientific areas for data exploration.
Core Standards of the Course
STRAND 1
Lists (Arrays)
Standard 1
Students will identify when to use a list
-
Student will create a list with strings and numeric values
-
Access a particular element in a list by using an index
Standard 2
Students will use the list methods to manipulate their lists
-
.append(), .pop(), and .insert()
-
.extend(), +, .reverse(), and .sort()
-
.join(), split()
Standard 3
Students will use a for loop with "in"
-
For example:
- fruits = ["apple", "banana", "cherry"]
- for x in fruits: print (x)
-
Students will use a for loop with range()
- For example:
- for x in range (4) print (x)
Performance Skills
-
use a variety of list methods
-
use a for loop with "in"
-
use a for loop with range()
STRAND 2
Indexes
Standard 1
Students will understand an index
-
The first index location is zero
Standard 2
Understand how a string is indexed
-
Work with string characters by index
Standard 3
Students will slice a string into substrings
-
Students will slice a list into sub lists
Performance Skills
-
Find the location of an element in a list
-
Slice a string into substrings
-
Slice a list in to sub lists
STRAND 3
Working with Files
Standard 1
Students will be able to:
-
Import files into Jupyter notebooks by using the curl command.
-
Read a local file in memory.
-
Use .read() to read a specific number of characters.
Standard 2
Students will be able to:
-
Use .readlines() to read text from files as a list of lines.
-
Use .close() to free system resources.
Standard 3
Students will be able to:
-
Use .readline() to read data from a file one line at a time.
-
Use .strip() to remove newline characters and other whitespaces.
Standard 4
Students will be able to:
-
Use .seek() to set file read and write locations.
-
Use file append mode.
Standard 5
Students will be able to:
-
Use .write() to write to a file
-
Use file append mode to append to a file
Performance Skills
-
Use .read() to read a specific number of characters.
-
Use .readlines() to read data from file as a list of lines.
-
Use .readline() to read data from file a line at a time.
-
Use .strip() to remove newline characters.
-
Use .write() to write data to a new local file.
-
Use .seek() to set file read or write location.
-
Use file append mode.
http://www.uen.org - in partnership with Utah State Board of Education
(USBE) and Utah System of Higher Education
(USHE). Send questions or comments to USBE
Specialist -
Kristina
Yamada
and see the CTE/Digital Technology website. For
general questions about Utah's Core Standards contact the Director
-
THALEA
LONGHURST.
These materials have been produced by and for the teachers of the
State of Utah. Copies of these materials may be freely reproduced
for teacher and classroom use. When distributing these materials,
credit should be given to Utah State Board of Education. These
materials may not be published, in whole or part, or in any other
format, without the written permission of the Utah State Board of
Education, 250 East 500 South, PO Box 144200, Salt Lake City, Utah
84114-4200.