this is the nav!
Introduction to Python
• AI Chat
• Code
• Report
• ## .mfe-app-workspace-kj242g{position:absolute;top:-8px;}.mfe-app-workspace-11ezf91{display:inline-block;}.mfe-app-workspace-11ezf91:hover .Anchor__copyLink{visibility:visible;}Introduction to Python Sandbox

👋 Welcome to your new workspace! You can use this interactive notebook to take notes, explore the course data, and practice your Python skills. There is also a cheat sheet at the bottom to use as a reference for later!

A sample of the data from Introduction to Python has been defined as lists in the cell below.

Click inside the cell and press "Run" to execute the pre-written code or adapt it and write your own!

```.mfe-app-workspace-11z5vno{font-family:JetBrainsMonoNL,Menlo,Monaco,'Courier New',monospace;font-size:13px;line-height:20px;}```# Import numpy
import numpy as np

# Assign the names to a list
names = np.array(['Kiko Calero', 'Armando Benitez', 'Delmon Young', 'Greg Maddux', 'J.D. Drew', 'James Loney', 'Jeff Ridgway', 'Ronny Cedeno', 'Omar Infante', 'Wandy Rodriguez'])

# Assign the positions to a list
positions = np.array(['Pitcher', 'Pitcher', 'Outfielder', 'Pitcher', 'Outfielder', 'Infielder', 'Pitcher', 'Infielder', 'Infielder', 'Pitcher'])

# Assign the heights to a list
heights = np.array([73, 76, 75, 72, 73, 75, 75, 72, 72, 71])

# Print the mean height of the players
print(np.mean(heights))``````

Alternatively, you can create a blank Python workspace and code in a fresh notebook!

## Introduction to Python Interactive Cheat Sheet

Below are some interactive examples of things you learned from the course. Bookmark this page as a reference and a place to experiment with queries!

### Math and variables

You can use Python as a calculator, performing things like addition, subtraction, multiplication, and division.

You can assign values to variables using the `=` sign.

You can use the `type()` function to determine the type of a variable.

To convert the type of a variable, you can use functions such as:

• `str()` to convert to a string.
• `int()` to convert to an integer.
• `float()` to convert to a float.

### Lists

You can create a list using square brackets `[]`, using commas to separate the values.

You can slice different parts of a list by using square brackets and numerical indices.

If you want to slice multiple values, you can use `:` to specify the start and stop (not included) of your slice.