Basic Math
Variables
General Python
Commands
Mystery Column
100

What character is used for division?

A slash (/)

100

What variable type stores letters, numbers, and symbols?

Strings

100

To make a comment in Python, what character(s) would you use?

A pound sign (##) at the beginning

100

Which command will display the text 'Hello world!' on the screen? 

A) print(Hello world!) 

B) print("Hello world!")

C) print "Hello world!" 

D) print = "Hello world!"

B) print("Hello world!")

100

What data type is 3.95?

Float

200

What operator is used for multiplication?

A single asterisk (*)
200

What variable type stores decimal numbers?

Floats

200

What is an error based off a typo?

Syntax error (essentially a grammatical error)

200

Which command will correctly ask the user for their age? 

A) age = input(How old are you?) 

B) input("How old are you?") = age 

C) How old are you = input() 

D) age = input("How old are you?")

D) age = input("How old are you?")

200

What does input do? 

A) It allows users to change the program 

B) It allows a user to solve a task 

C) It converts data types 

D) It allows users to enter data

D) It allows users to enter data

300

To raise a number to a power (ex: Xy), what symbol would you use? (This is the power operator)

Two asterisks (**)

300

What function allows user input text to be assigned a variable?

input()

Ex: example_input()

300

What is the difference between the = and == operators?

= is to assign a value to a variable

== is used to compare the value of two variables

300

In the following example, Is myName a string, a function, a variable, or a method?

myName = input()

Variable

300

What would happen in the following: number = int('5.0')

a. Converts to integer, becoming 5

b. Keeps as a string

c. Gets an error

c. Gets an error

400

If multiple calculations must be made, what order does Python use?

PEMDAS

400

Data stored as a string is surrounded by what?

Quotes ("")

400

What are the four main types of data types?

- Strings (str)

- Integers (int)

- Floats (float)

- Boolean (true/false)

400

What is the result of this command? print ("5" + "3") 

A) 8 

B) "8" 

C) "5" + "3" 

D) 53

D) 53

400

Which of these codes tests whether the variable x is the same as 'Hello'? 

A) x = "Hello" 

B) x == "Hello"

C) x != "Hello" 

D) x <> "Hello"

B) x == "Hello"

500

Denoted as '%', this operator returns the remainder of a division operation. What is the name of this operator?

Modulus

500

After creating a function and writing all the code, what must be done for the function to run in Python?

You must call the function

Ex:

def SI_is_bussing()

     Code

     More code

SI_is_bussing()

500

To specify a variable type, what would you use to denote integers, floats, and strings?

int()

float()

str()

500

The following code would not run. What is wrong with it, and how can it be fixed?

name = "Bob"

print(Name)

"Name" is supposed to print, but there's no variable "Name". It needs to be uncapitalized as "name" for it to print "Bob".

500

What would the output of this program be? 

number1=3

number2=7

number3=5

print(number1+number2*number3)

38