Variables
If-else
Loops
Functions
Misc
100

Write a program that prints the type for a string, integer, and double.

print(type(5))

print(type("Hello"))

print(type(5.0))

100

What is a boolean?

A boolean is a True or False statement

100

How are loops helpful?

They help programmers with code that is repeated multiple times.

100

How are functions helpful?

Functions help organize code and allow programmers to reuse repetitive code

100

What is your Instructor's name?

Thomas/Tommy/Tom Robbins

200

What is an integer?

A data type that stores whole numbers

200

What statement is true?:

Ice is cold

The sky is green

This sentence is true

The previous sentence is false

Ice is cold

200

Create an infinite while loop that prints "Hello there"

while true:

  print("Hello there")

200

Create a function that prints your favorite food.

def food():

  print("favorite food")


food()

200

What software allows use to draw using python?

Python with turtle

300

Write a program to cast a integer into a string

numString = str(5)

300

Write a program that asks the user a yes or no question and use an if statement to check if they entered a yes or no. If yes, print good. If no, print wow, you should have said yes.

userInput = input("Question goes here")

if userInput == "yes"

  print("good")

if userInput == "no"

  print("wow, you should have said yes")

300

Write a program and use a loop to count from 0 - 10

for i in range(0,11):

  print(i)

300

write a program that passes 2 integers into a function. Then the function adds the 2 integers and prints the sum.

def add(num1, num2):

  print(num1 + num2)

add(5, 3)

300

Who created Python?

Guido van Rossum

400

Can you use arithmetic addition to add a sting and integer?

No

400

Create a nested if statement and have the outside if statement check if a number is less than 20 and the inside statement checks in a number is greater than 10. Include an else statement with the inner if statement for any number less than or equal to 10.

if num < 20:

  if num > 10:

    print("greater than 10 but less than 20")

  else:

    print("Less than or equal to to")

400

Write a program and use a loop to count from 0 to -100 in intervals of 5

for i in range(-100, 0, -5)

  print(i)


400

write a program that passes 1 integer into a function. The function will then check if the integer is odd or even and print the result.

def odd_even(num1):

  if num1 % 2 == 0:

    print("even")

  else:

    print("odd")

odd_even(6)

400

How did python get it's name?

Monty Python

500

Can you use arithmetic addition to add a double and integer?

Yes

500

Draw an AND truth table

false | false | false

true | false | false

false | true | false

true | true | true

500

Use a loop to print out each letter in the word "Hippopotomonstrosesquippedaliophobia" with a space between each letter.

for i in "Hippopotomonstrosesquippedaliophobia":

  print(i, end = ' ')

500

Daily double:

Create a function that adds two numbers and then pass the sum to another function that subtracts the sum by 5. Print the result outside of the functions

def add(num1, num2):

  sum = num1 + num2

  return subtract(sum, 5)

def subtract(num1, num2):

  diff = num1 - num2

  return diff

x = add(7,3)

print(x)

500

I ran out of ideas for this category so have a free 500 points.

:)

M
e
n
u