Parts of a Computer
Python Arithmetic
Python While Statements
Abstraction
Identify Parts of Code
100

What is the main function of the CPU?

The CPU processes instructions and performs calculations.

100

What operator is used for addition in Python?

 +

100

What keyword is used to start a while statement in Python?

while

100

What is abstraction in computer science?

concept of hiding complex implementation details and showing only the essential features of an object

100

count = 2

while count<3

[indent] print(count)

[indent] count =count +1

What is the variable?

count

200

Name the component that stores data temporarily while a computer is running.

 RAM (Random Access Memory)

200

How do you perform exponentiation in Python?

the ** operator

200

What is the output of 

count = 3

while count < 5: 

[indent] print(count) 

[indent] count += 1

  3 4

200

Give an example of a real-world abstraction.

many... ex.  a car key; it allows you to start the car without needing to understand the mechanics of the engine.

200

count = 2

while count<3

[indent] print(count)

[indent] count =count +1

What does count < 3 hold?

a boolean (true or false value)

300

What is a Boolean data type?

holds values true and false

300

What is the output of the expression 5+3×2

11

300

What is the purpose of the 'break' statement in a loop?

The 'break' statement is used to exit a loop prematurely.

300

How does abstraction help in programming?

Abstraction helps in programming by reducing complexity and increasing efficiency, allowing programmers to focus on higher-level tasks.

300

count = 2

while count<3

[indent] print(count)

[indent] count =count +1

What is the function being used?

print()

400

What is machine language?

A low-level language made of binary code directly executed by the CPU

400

How would you calculate the average of three numbers in Python?

  •  average = (num1 + num2 + num3) / 3

400

How many times will the loop run in this code?

x = 4 

while x < 5:

[indent] print(x) 

[indent] x += 1

1 time

400

Define the term "function" in the context of programming.

 a reusable block of code that performs a specific task.

400

For the following code:

import turtle as trtl

beck = trtl.Turtle()

beck.forward(100)

beck.right(90)

wn = trtl.Screen()

wn.mainloop()

trtl, beck, wn

500

Explain the difference between hardware and software

Hardware refers to the physical components of a computer, while software refers to the programs and applications that run on the hardware.

500

What is 8 % 5?

3

500

How many times will the loop run in this code?

y = 4 

while y < 3:

[indent] print(y) 

[indent] y += 1

0 times

500

Why is it important to use functions in programming?

Using functions in programming is important because they promote code reusability, improve readability, and help in organizing code logically.

500

How many times does it turn left:

def turn_right():

    turn_left()

    turn_left()

    turn_left()

    

move()

turn_left()

move()

put_ball()

move()

put_ball()

turn_ right()

turn_right()

7

M
e
n
u