Lab Write Up 9

Name: Cameron Beattie

Period: 7

Assignment: Lab #9

Problem Overview

This problem focused on using lists to organize and sort even or odd numbers

My Solution

I had the sprite ask for a number, then if used the mod tool to test if it was even or odd by dividing by 2. if the remainder was 0, then the number was placed into a list called "evens", otherwise it was sorted into a list called "odds"

Project Link

Problem Overview

This problem focused on using lists to determine whether a shape was regular using the distance formula.

My Solution

I had the sprite ask for a number of sides and then some ordered pairs. Then those pairs were sorted into lists abd the distance between each pair was calculated. The distances were then compaired and if they weren't all equal, the the sprite says the shape is not regular, otherwise the sprite says the sprite is regular.

Project Link

Questions

  1. What is the length of an “empty” list?
    • The length of an empty list is 0
  2. Why are lists more powerful than variables?
    • Because lists can hold multiple values at a time, while variables can't
  3. Can a list contain different data types? For example, could it store both numbers and words?
    • Yes, a list can contain multiple data types