Formatting
Errors/Random
Definitions
Tell me...
Random
100

How do you format a print statement?

print ("text")

100

How do you format a comment?

#type anything here : )

100

What does string concatenation mean?

The combination or addition of two strings.

100

Tell me what an USB is?

1) A secondary memory

2) An input

100

Explain the logic behind how a user input variable works.

The user is asked the prompt, the input is then saved in the variable.

200

How do you format a while-loop?

  • while condition:

    • Statement

    • Statement

200

What is the error?


_greeting1 = "HI, THERE"

print (_greeting1)

There is no error.

200

What is a function?

A body of prewritten code that performs the same operation once called.

200

What is the default value of a range function in a for-loop when no beginning value is given?

0

200

What is something that you must always include in a while loop?

A loop-breaking condition/statement.

300

How do you format a nested if-statement?

if condition:

          if condition:

                Statements

          else:

                Statements

else:

          Statements


300

Do you really want to reveal the question?

Yes: You get the question.

No: You get a free 100 points

Brave.


You get 400 points

300

What is a condition-controlled loop?

A loop that uses True or False boolean values to control the number of times that it repeats.

300

The five main components of a computer

1) input

2) output

3) CPU

4) Main Memory

5) Secondary memory

300

What does the break statement do?

It breaks a loop. This makes it so that the loop stops iterating altogether.

400

How do you format an elif statement?

  • if condition:

    • Statements

  • elif condition:

    • Statements

  • elif condition:

    • Statements

  • elif condition:

    • Statements

  • else:

    • Statements

400

What is the error?

name = Jhonny

print("Hi there", \t, name)

The escape characters go inside the string literals.

400

What is an Iteration?

A single execution of the body of the loop.

400

The five rules for variables / variable naming 

1) cannot be a keyword

2) Cannot contain spaces

3) 1st character cannot be a number

4) Can only have letters, numbers, and underscores.

5) Variables are case-sensitive.

400

What does a continue statement do?

It breaks the current iteration. This makes it so that the current iteration in the loop stops and the next one begins.

This is regardless of the position of the program in the iteration.


500

How do you format a for-loop with a range?

  • for variable in range (Val):

    • Statement

    • Statement

500

How do you format the statement that checks the datatypes of a variable?

print(type(variable))

500

What is a separation character?

A visible character that appears as a separation of two or more items in a print statement.

500

In a for-loop range function, what do the first, second, and third arguments represent?

  • First argument = Beginning

  • Second argument = End (not including)

  • Third argument = Step

500

You are brave.

Choose one. Answer the question for 1000 or retreat and receive 100 points.

Question: What does the % operator do?

It divides one number by another and returns the remainder. *NOT THE RESULT*