Non-programming
Conditional Statements/ Variables
Loops
Input/Strings
100

What number system do we use everyday?

Decimal

100

Name two data types in Python


  • Numbers

  • String

  • Boolean

  • List

  • Tuple

  • Dictionary



100

What two loops have I taught you?

for loop and while loop

100

What do you use to take info from a user?

input()
200

What number system is base 16?

Hexadecimal

200

What is the syntax for the conditional statement I taught you?


if condition:

    #code

elif condition:

    #code

else:

    #code

200

Write a for loop to loop through 0-4 and print them out

for i in range(5):

     print(i)

200

Find the length of s and print it out

s = "yayyyy"

print(len(s))

300

Convert 1010102 to decimal

4210

300

What is a module?

Contain variables, functions, and classes. Contains Python code.

300

Write a while loop to loop backward through 0 to -3

i = 0

while i>=-3:

     print(i)

     i--

300

check if s begins with hi and print the result

s = "hi buddy!"

print(s.startsWith("hi"))

400

Find f(12,6)

f(x,y)={

           f(x-y, y-1)+2     when x>y

           x+y                  otherwise

           }

9

400

What do you use to gain access to other modules?

An import statement

400

What do you use to leave a loop early?

break

400

Find the character at the last index of s and store it in a new variable


s = "hi hi hi"

c = s[len(s)-1]

500

Convert 100016 to octal

100008

500

Name a keyword in python

and, break, else, continue, for, if, while, elif, while, or, not, etc.

500

Convert this to a for loop

i = 0

while i>-2:

     print(i)

     i--

for i in range(0, -2, -1):

     print(i)

500

What is the output when the user enters 6?

x = input("hi");

print(x/2)

The code causes an error to occur
M
e
n
u