Terminal Commands
Strings/Lists
Loops
Find the Error
Programs
100

What does cd stand for?

change directory

100

What is a list method?

A function that can be used on lists

100

prints 0, 12, 24, 36, 48, 60, 72

100

I want to create a program that adds two ages. Here is my attempt: 

What should this print out if I input age1 for 10 and age2 for 5? 

"105" 

The error is age1 and age2 were never converted to integers! 

100

What does this program print if the user inputs 125 for price and 10 (as a percent) for tax? 

137.5

200

What does the command code do?

open a file

200

What is a string in terms of a list?

A string is a list of characters

200

prints 200, 180, 160, 140, 120, 100 

200


I want to print out every element in the list. Will this program do that? Why or why not?

This program will print out every element in the list other than the first one. Indices start at 0 not 1!

200

What is printed out from this program?

[4,2,3]

300

mkdir is used for. 

make directory/folder

300
name = ['Jayden', 'Alyssa', 'Alexis', 'Grant', 'Maricar', 'Colin']


What happens in the following line:

print(name[-8]) 

IndexErrror: Out of Range

300

When should a while loop be used over a for loop and vice versa?

A while loop should be used when you don't know how long the loop is run or you want to stop at a certain condition. A for loop should be used when you know exactly how many times the loop should run. 

300

What does this program print out? I'm trying to find print the numbers between 10 and 200. 

The program prints 10. You should check that x > 200 instead of x < 200.

300

What does this program do?

prints the year when someone turns/turned 90
400

How does one move back one directory/folder in the terminal?

cd ..
400

lst = [[5,7,8], [9, 12, 5], [6, 7, 8]]

What is the result of the program below:

5 7 8 

9 12 5 

6 7 8 

400


123 

456 

789

400

I'm trying to return the sum of the digits in a number. What should this program return if I input the 575. 

It will give a list is not subscriptable error. Integers are not iterable where we can use a for loop to go through each digit. You would need to either convert the number to a list of digits or a string! 

400

What list does this program print out?

[8, 10, 3, 8, 6, 14, 10, -10, 3, 4, 'hello', 'JaydenJayden']

500

How do you run a python program?

python [filename.py]

500

[20, 5, 7, 8, 12, -5, "hello", "Jayden", True, False, "Alyssa"]

500

What value does this function return when string = "abc"

6

500

What should this function return if I call search(2, [5,6,7,2])

It'll return an error. We should check if "value in list" instead of "list in value"

500

What does this function do?



return the factorial of x 
M
e
n
u