Section 1

Preview this deck

What does the CPU do with Data?

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

1

All-time users

1

Favorites

0

Last updated

1 year ago

Date created

Mar 1, 2020

Cards (65)

Section 1

(50 cards)

What does the CPU do with Data?

Front

It reads and interprets the data and determines the sequence for processing the data.

Back

What does isdigits do?

Front

lets you know if a string is only digits or not

Back

What is it called when we check input?

Front

input validation

Back

How do you check if two strings are equal in Python?

Front

== symbol

Back

What is a constant in Python?

Front

a variable whose value should not be changed after it's assigned an initial value

Back

What is a return value?

Front

The output that a round function computes

Back

Is 10,000 a valid number literal?

Front

no because there is a comma

Back

name = "Don" what is name[0]?

Front

D

Back

What is an algorithm?

Front

An algorithm is a step by step description of how to solve a problem.

Back

Algorithm for brushing your teeth, please create one

Front

1. Get toothpaste from cabinet 2. Get toothbrush from cabinet 3. Put toothpaste on toothbrush 4. Wet toothpaste on toothbrush 5. Brush teeth for 2 min. 6. Spit out toothpaste 7. Rinse mouth 8. Rinse toothbrush 9. Return toothbrush to cabinet 10. Return toothpaste to cabinet

Back

Give a example of a built in math function

Front

abs (x) = gets the absolute value of "x"

Back

Is 12pack a valid variable name? Why?

Front

no because it starts with a number

Back

Algorithm is a sequence of ?

Front

A sequence of steps to help solve a problem.

Back

parenthesis number is it always even or odd?

Front

even

Back

Concatenate what does it mean?

Front

adding one string to the end of another string

Back

What is a common error with if statements?

Front

duplication in branches

Back

What's the difference between software and hardware?

Front

Software is an application program such as Microsoft Word. Meanwhile, Hardware consists of the physical elements in a computer system.

Back

Why would 4 = 20/5 cause an error as a relational operator?

Front

it should be 4 == 20/5.

Back

Give 3 examples of relational operators in python

Front

> greater than < less than == equal to

Back

What is the ALU?

Front

The ALU or arithmetic logic unit holds the circuitry to carry out calculations and perform comparisons.

Back

Name 2 different data types in Python

Front

integer, float, string

Back

What is the only way to get false as an answer when using or?

Front

only if both conditions are false

Back

price = round(6.6554, 3) what is the value of price?

Front

6.655

Back

What is a variable?

Front

A variable is a named storage location in a computer program

Back

What does the in operator check for?

Front

the in operator analyzes or asks certain questions about a particular string

Back

Do the if and else words have to be aligned?

Front

yes they have to be aligned

Back

What is an escape sequence?

Front

an escape sequence uses the "\" backslash to enter a new line of text without leaving the same print function

Back

Whats the value of length?

Front

The value of length is 5

Back

What symbol do we use for a comment in Python?

Front

#

Back

What does is alpha do?

Front

isalpha checks to see if the string contains only alphabetical characters.

Back

What does CPU stand for in computer science?

Front

Central Processing Unit

Back

What is a function?

Front

A sequence of instructions with a name

Back

What is the input and output for the round function

Front

input is argument, output is return value

Back

How does the ends width work with file extensions?

Front

Endswith makes sure the file has the correct extension with an if statement

Back

How do we identify a constant in Python?

Front

A constant is identified in ALL CAPS

Back

5 % 4 in Python?

Front

1

Back

Is dog pound a valid variable? Why?

Front

no because it has a space

Back

Square with color

Front

import turtle turtle.shape("turtle") turtle.color("red") turtle.forward(90) turtle.left(120) turtle.color("blue") turtle.forward(90) turtle.left(120) turtle.color("green") turtle.forward(90)

Back

What is the header of a function?

Front

The header of a function includes the name of the function and tells what type of data it expects to receive and the type of data it will return to the calling function.

Back

What does a function call do?

Front

a function call orders a function to execute its instructions

Back

What do you think nesting refers to with if statements?

Front

Using an if statement within an if statement

Back

write a python program that inputs your name and year you graduate

Front

name = input("What is your name?")grad_year = int(input("What year will you graduate?")) print("My name is", name, "and I graduate in", grad_year)

Back

What does the colon indicate in an if else statement?

Front

the colon indicates a compound statement

Back

Whats an example of secondary storage?

Front

Secondary storage is a flash drive that does not need electric power.

Back

How large is a megabyte?

Front

1,048,576 bytes

Back

What type of branching is an elif?

Front

multiway branching

Back

What does a computer program do?

Front

A computer program tells a computer the sequence of steps needed to complete a specific task.

Back

What is the only way to get true when using an And?

Front

only if both conditions are true

Back

How does assignment work in Python?

Front

The assignment statement '=' is used to place a new value into a variable

Back

PEMDAS what does it stand for?

Front

Parentheses, Exponents, Multiplication/Division, Addition/Subtraction

Back

Section 2

(15 cards)

Write a python program that uses a while to print out 0 to 100 by tens.

Front

counter = 0 while counter < 101: print(counter) counter = counter + 10

Back

What is a sentinel value?

Front

a sentinel value denotes the end of a data set but is not part of the data

Back

What can a boolean variable be set to value wise.

Front

true or false

Back

Argument vs Parameter what is the difference?

Front

The argument value contains the contents of a variable, while the parameter variable is declared in the called function which is initialized with the value of the argument value.

Back

1. Write a python program that uses a for loop to print out your name ten times, includethe counter values(ie.)0 john doe1 john doe

Front

for num in range (10): print(num, "Griffin" )

Back

Write a python program that uses a while loop to print out your name ten times, includethe counter values(ie.)0 john doe1 john doe

Front

counter = 0 while counter < 10 : print(counter, "Erica") counter = counter + 1

Back

Do functions have to have return values?

Front

Functions do not have to contain return values.

Back

Can you increment by two with a for?

Front

yes, as long as you specify the step value as the third argument

Back

Can the main program be a function?

Front

Yes

Back

Is it better to use less than or less than or equal to in loop conditions

Front

Less Than

Back

What causes a while loop to terminate?

Front

A while loop terminates when the loop condition is false

Back

Write a python program to print out 2,4,6,8 "who do we appreciate" using a foor loop with an increment of 2

Front

for evennum in range(2,9,2): print(evennum) print("who do we appreciate")

Back

Can a for be used to substitute for a while?

Front

a for can substitute for a range within the while; so, it can contain a range that remains as a true condition within a while loop

Back

Can a function have more than one return?

Front

Yes but every branch must have a return statement.

Back

How does an infinite while loop occur?

Front

An infinite while loop occurs when the condition is always true

Back