Name: Colin Yang

Period: 7

Assignment: Lab #9

Lab Overview Problem #1

This lab asked us to make a program that took a certain amount of numbers that the user decides and add them to a list. Then, it would determine if each number is either odd or even and put it accordingly in a separate list. Finally, if the number of even numbers at the end is larger than the number of odd numbers, it would switch to the next costume.

My Solution

My solution included a block "even or odd" with a number string. In it, it stated that if the number1 mod 2 is equal to 0, it would say "It's Even" and then add the number1 to the even list. Else, it would say "It's Odd" and then add the number1 to the odd list. Afterwards, when the green flag is clicked, the sprite would ask the user how many numbers they want in their list, and set the answer to the variable list number. Following that is a repeat "list number" times, with a program that asks the user "Give me a number", add the answer to the user number list, and determine if it's even or odd. After the program had repeated itself "list number" of times, if the length of the even list is greater than the length of the odd list, the sprite would switch to the next costume.

My Project Link


1.What is the length of an “empty” list?

An "empty" list and a length of zero.

2.Why are lists more powerful than variables?

Lists are easier to use, as the user doesn't have to create a new variable for each data, but instead add it to a list that could be referred back to.

3.Can a list contain different data types? For example, could it store both numbers and words?

Yes, a list is able to store both numbers and words in it.