Day 2
if Statements
- A Simple Example
- if Statements
- Using if Statements with Lists
- Styling Your if Statements
Dictionaries
- A Simple Dictionary
- Working with Dictionaries
- Looping Through a Dictionary
- Nesting
7. User Input and while Loops
- How the input() Function Works
- Writing Clear Prompts
- Using int() to Accept Numerical Input
- The Modulo Operator
- Accepting Input in Python 2.7
- 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