A
B
C
D
E
100

Which function can be used to convert a float to an integer?

int()

100

What will this code output?

print("5" + str(2))

52

100

What does this code do?

x = input("Enter a number: ") 

y = int(x)

print(y*2)

Doubles the input number

100

What will this print?

print("Result:", 4+3)

Result: 7

100

Which of the following is a Python data type?  Select all that apply.


int, str, and float


200

What does this code print?

name = input("Enter name: ")

print("Hi", name)


It asks for name and prints a greeting

200

What is the correct way to convert user input into a integer? 

int(input())

200

What does this code do?

num = input("Enter a number: ") 

print(num + 1)

Returns an error

200

What will the following code print?

print("7" * 2)

77

200

What happens if you forget to close a string with quotes in print()?

It raises a syntax error

300

What does this code print?

 

x=5

y=int(x)

print(y+3)

8

300

What does this code do?

age = input("Enter your age: ")

print("You are", age, "years old.")

Takes input and prints a message

300

Which of these is NOT a valid variable name in Python?

2ndgrade

300

What will the following code output?

name = "Alex"

print ("Hello", name)

Hello Alex

300

Which of these best describes a variable in Python?

A container for storing data

400

Which symbol is used to write comments in Python?

#

400

What does the (int) function do in Python?

Converts a string to an integer

400

What will be the output of the following code?

print(3 * "7")

777

400

What data type is returned by input() by default?

String

400

What does the print() function do?


Displays information on the screen

500

What is a parameter in a function?


A value or input that can be passed into the function

500

What is a condition?

A rule that controls whether code will run

500

What does it mean to 'call' a function?

Run or execute the function by its name.

500

Why do we define new function in Karel programs?

To make programs shorter and easier to read

500

what's my favorite animal?

horse