Lab Write Up

Name: Sam Basilico

Period: 7

Assignment: Lab #9

Lab Overview

In this lab, the task was to create a calculator that recieved a list of numbers and then listed off the numbers saying if they were odd or even. At the end, it had to figure out if there were more even numbers than odd, and if it was true, it changed costume.

My Solution

My solution to create 3 variables and a block. In the block it determined if the input was odd or even. If it was was odd or even, it would add 1 to their respective varaibles that decided if it should switch costumes. In the real code, it asked for the number and if it wanted to continue the list after each input. If the user said yes, it was set to ask again. If the user said no, it was set to stop asking and then use the block to say which ones were odd and even. Then after that, if the odd vairable was less than the even, it would change costume.

My 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?
    • A list is more powerful than a variable because it can hold more than one value.
  3. Can a list contain different data types? For example, could it store both numbers and words?
    • yess....