Data Types
Operators
Find and Fix the Bug
Libraries
What's printed?
10

What is the data type of x?

x = 3

int, integer

10

x = int( 5 + 3.14)

print(x)

8

10

#Find the syntax error

num = 5

print("The number is: " str(num))

num = 5

print("The number is: " + str(num))

10

What is the library to import for math functions in python

math

import math

10

n = 5

print ('n')

n

10

What is the data type of num?

num = "five"

str, string

10

first = "Nothing"

last = "None"

name = first + "last"

print(name)

Nothinglast

10

#Find the logical error

bat = 5

#Print the value of bat after the prompt

print("value of bat: + bat")

bat = 5

print("value of bat: " + bat)

10

what is the math function for finding the absolute value of a number

math.fabs()

10

something = input("enter something: ")

x = something * 2

print("you entered " +  x)

#user inputs 10

1010

20

What is the line of code to convert doorNo to an integer named x

doorNo = "5"

x = int(doorNo)

20

n = 5+2/2

print(n)

6

20

#Find the syntax error

x= integer(5.2)

y = x+ 5.2

x= int(5.2)

y = x+ 5.2

20

what is the math function to find the square root of a number

math.sqrt()

20

x = 3.6

y = x/2

print (y)


1.8

20

what is type casting?

converting from one data type to another 

eg.

int(3.14)

str(2)



20

import math

f = math.sqrt(25)

print (f)

5.0

20

#Find the syntax error

x = input(enter a decimal)

y = x+5

print("y")


x = input("enter a decimal")

y = x+5

print("y")

20

What is the library for for random number functions

import random

20

name = "ben"

class ="python"

print("name" +  " is in my " + class + " class")

name is in my python class

50

What data type does the input() command return

string

Always a string

50

import math

n = -4

n = n * n

n = math.fabs(n)

print(n)

16.0

50

#Find the syntax error

import math

n = maths.sqrt(16)

print("n")

import math

n = math.sqrt(16)

print("n")

50

random.random() generates a random number between ? and ?

0.0 and 1.0

0 and 1 is acceptable

0 is inclusive, 1 is not inclusive

50

print("this is a poem\nit has many lines/nlike these")

this is a poem

it has many lines/nlike these

M
e
n
u