If / Else Statement
Variables
Computer Hardware
Methods
Fix the Code
Python
100

This is used if the if condition wasn't true

What is else

100

These are the 4 main types of data

What is a string, a integer, a float, and a boolean

100

This is the brains of the computer

What is a CPU

100

You can use this method to display info to the user

What is print

100

a = 3

b = 4

if a < b:

     print("A is greater then B")

The if statement is checking if a is less than b instead of the other way around.

100

If you want to set something to a value you would use this operator.

What is =

200

This goes at the end of every if statement

What is a colon (:)

200

This is a variable with only two possible values

What is a Boolean

200

This is a volatile form of temporary memory

What is RAM

200

This method can be used to receive data from the user

What is input

200

year = 2018

age = input("What is your age")

birth = year - age

print(birth)


age is checking for a string instead of an int

200

If I want to use floor division I would use this operator.

What is //

300

This is used for checking a different set of if conditions in the same if chain

What is elif

300

This variable has an infinite number of values between 0 and 1

What is a float

300

A magnetic storage drive in computers

What is a Hard Disk Drive

300

These is used to add an argument to a method

What are parenthesis

300

1year = 2016

2year = 2018

print(year2 - year1)

You can't start variable names with numbers

300

If you wanted to have a multi line comment you would use this.

What is ''' and '''

400

This can be used to check multiple conditions in an if statement

What is and

400

True or False

There is no limit to what you can name a variable

False

There are a few rules including no spaces and not begining with a number

400

This is commonly refereed to as the MOBO or mainboard

What is a motherboard

400

True or False:

Capitalization is not important for methods.

False

Capitalization is incredibly important

400

James' Pet = "Stanley"

Jessica Loves = James' Pet

print(Jessica Loves)

You cannot have spaces in variable names

400

These are used to help other programmers understand our code.

What are comments

500

What does this print


age = 20

year = 2018

birth = year - age

if birth > 1989 and birth < 2000

     print("You're a nineties kid")

elif birth > 2000:

     print("What up cool dude")

else:

     print("What are you")

print("Done")

You're a nineties kid

Done

500

What is A at the end


a = 6

b = 12

c = 18

if c == 6*3:

     a = a + c + b

if b < c - a:

     a = a*3

print(a)

A is 36

500

This this allows power to be sent to the rest of the computer.

What is a PSU

500

What does this print if the name is John, the flower is Roses and the love is 5


name = input("What is your name")

flower = input("What's your favorite flower")

love = int(input("How much do you love that flower"))

if love == 5:

     print(name + " loves " + flower)

else:

     print(name + " likes " + flower)

John loves Roses

500

number = int(input("What is your favorite number")))

print(number)


There is one to many parenthesis on number

500

These are used to write documentation alongside code that can later be pulled by IDE's, websites, or printed documentation.

What is a Docstring

M
e
n
u