PYTHON
Introduction
Basic’s of Python
6 Topics
Python Versions
Running Snippets of Python Code
About the Sublime Text Editor
Python on Windows
Running a Hello World Program
Configuring Sublime Text
Variables and Types
16 Topics
Naming and Using Variables
Avoiding Name Errors When Using Variables
Variables Are Labels
String Variable
Changing Case in a String with Method
Using Variables in Strings
Adding Whitespace to Strings with Tabs or Newlines
Stripping Whitespace
Avoiding Syntax Errors with Strings
Numbers
Floats
Integer
Integers and Floats
Underscores in Numbers
Multiple Assignment
Constants
Introducing Lists
13 Topics
What Is a List?
Accessing Elements in a List
Index Positions
Using Individual Values from a List
Modifying Elements in a List
Adding Elements to a List
Removing Elements from a List
Organizing a List
Sorting a List Permanently with the sort() Method
Sorting a List Temporarily with the sorted() Function
Printing a List in Reverse Order
Finding the Length of a List
Avoiding Index Errors When Working with Lists
Working with lists
28 Topics
Looping Through an Entire List
A Closer Look at Looping
Doing More Work Within a for Loop
Doing Something After a for Loop
Avoiding Indentation Errors
Forgetting to Indent
Forgetting to Indent Additional Lines
Indenting Unnecessarily
Indenting Unnecessarily After the Loop
Forgetting the Colon
Making Numerical Lists
Using the range() Function
Using range() to Make a List of Numbers
Simple Statistics with a List of Numbers
List Comprehensions
Working with Part of a List
Slicing a List
Looping Through a Slice
Copying a List
Tuples
If Statements
20 Topics
A Simple Example
Conditional Tests
Checking for Equality
Ignoring Case When Checking for Equality
Checking for Inequality
Numerical Comparisons
Checking Multiple Conditions
Checking Whether a Value Is in a List
Checking Whether a Value Is Not in a List
Boolean Expressions
Simple if Statements
if-else Statements
The if-elif-else Chain
Using Multiple elif Blocks
Omitting the else Block
Using if Statements with Lists
Checking for Special Items
Checking That a List Is Not Empty
Using Multiple Lists
Styling if Statements
Dictionaries
17 Topics
A Simple Dictionary
Working with Dictionaries
Accessing Values in a Dictionary
Adding New Key-Value Pairs
Starting with an Empty Dictionary
Modifying Values in a Dictionary
Removing Key-Value Pairs
A Dictionary of Similar Objects
Using get() to Access Values
Looping Through a Dictionary
Looping Through All Key-Value Pairs
Looping Through All the Keys in a Dictionary
Looping Through a Dictionary’s Keys in a Particular Order
Looping Through All Values in a Dictionary
Nesting – A List of Dictionaries
Nesting – A List in a Dictionary
Nesting – A Dictionary in a Dictionary
User input and while loops
15 Topics
How the input() Function Works
Writing Clear Prompts
Using int() to Accept Numerical Input
The Modulo Operator
Introducing while Loops
The while Loop in Action
Letting the User Choose When to Quit
Using a Flag
Using break to Exit a Loop
Using continue in a Loop
Avoiding Infinite Loops
Using a while Loop with Lists and Dictionaries
Moving Items from One List to Another
Removing All Instances of Specific Values from a List
Filling a Dictionary with User Input
Functions
27 Topics
Defining a Function
Passing Information to a Function
Arguments and Parameters
Passing Arguments
Positional Arguments
Keyword Arguments
Default Values
Equivalent Function Calls
Avoiding Argument Errors
Return Values
Returning a Simple Value
Making an Argument Optional
Returning a Dictionary
Using a Function with a while Loop
Passing a List
Modifying a List in a Function
Preventing a Function from Modifying a List
Passing an Arbitrary Number of Arguments
Mixing Positional and Arbitrary Arguments
Using Arbitrary Keyword Arguments
Classes
Files and exceptions
Previous Topic
Next Topic
Using break to Exit a Loop
PYTHON
User input and while loops
Using break to Exit a Loop
Previous Topic
Back to Lesson
Next Topic
Login
Sign Up
Remember me
Forgot Password?
Sign in
I accept the
Terms of Service and Privacy Policy
Sign Up
Lost your password? Please enter your username or email address. You will receive a link to create a new password via email.
Email Reset Link
Login
Accessing this course requires a login. Please enter your credentials below!
Username or Email Address
Password
Remember Me
Lost Your Password?