While Loops
Variables
Math Operations/Errors
Input/Casting
If Statements
100

This loop executes statements repeatedly as long as the tested condition remains true

What is a while loop?

100

What is a variable?

  • A variable is something that can store information

  • It can be used or changed later

100

What symbol do we use for multplication?

*

100

What is input?

Input is when the user who runs the code gives a value for the program to use.

100

If an if statement is false, what statement is usually added on to it to do something else?

Else statement

200

Describe syntax of a while loop.

 

200

Variables are used to store ______ so that whoever is writing the code use it later or change it later

What is information?

200

What symbol do we use for division?

/
200

What line of code gets you the input?

var = input()

200

What statement is used when we want to write multiple if statements but only do statements from one?

Elif Statement

300

What loop:

  • Occurs when the condition will never be false

  • Can cause computer crashing

What is an infinite loop?

300

What are some naming rules for variables?

1. Variable names can only consist of letters, numbers, and underscores.

2. Names must start with an underscore or a letter

3. Names can NOT be started with a number

300

If you want to save the sum of two numbers in a variable, what line of code would you use? And what about to get division or multiplication? (Use any numbers you want)

sum = x + y

sum = x / y

sum = x * y

300

Which commands can you use around what you want to cast?

1. int()

2. float()

3. str()

4. bool()

300

What are the three types of logical operators in order of precedence?

Not, and, & or

400

What is a special input value that signifies the end of a loop?

What is a sentinel value?

400

What can variables be set to?

Integers, floats, strings, and booleans

400

What line of code is used to save the exponents of two numbers?

exponent = x ** y

400

What do you have to add to be able to get a random number?

import random

400

What symbol is used with each logical operator?

And: and

Or: or

Not: not

500

What is the main reason why while loops are useful?

They help us stop being repetitive and more efficient

500

What two values can a boolean have?

True and False

500

What are the three types of errors? (make sure you know the definition of each as well)

1. Compiler Errors

2. Run-time Errors

3. Logic Errors

500

How do you get random floats from a certain range?

1. Using random.random(), multiply that with the end value (will not include end). This will give you a value from 0-the end value.

2. To start from a different number, multiply instead by end number minus start number, and then at the end add the start number.

500

Write a program that takes three integer inputs and then checks to find the biggest of the three.

int1 = input()

int2 = input()

int3 = input()

if int1 > int2 and int1 > int3:

    print("Int 1 is greatest")

elif int2 > int1 and int2> int3:

    print("Int 2 is the greatest")

elif int3 > int1 and int3 > int2:

    print("Int 3 is the greatest")

else:

    print("They are all equal to each other")


M
e
n
u