Which function can be used to convert a float to an integer?
int()
What will this code output?
print("5" + str(2))
52
What does this code do?
x = input("Enter a number: ")
y = int(x)
print(y*2)
Doubles the input number
What will this print?
print("Result:", 4+3)
Result: 7
Which of the following is a Python data type? Select all that apply.
What does this code print?
name = input("Enter name: ")
print("Hi", name)
It asks for name and prints a greeting
What is the correct way to convert user input into a integer?
int(input())
What does this code do?
num = input("Enter a number: ")
print(num + 1)
Returns an error
What will the following code print?
print("7" * 2)
77
What happens if you forget to close a string with quotes in print()?
It raises a syntax error
What does this code print?
x=5
y=int(x)
print(y+3)
8
What does this code do?
age = input("Enter your age: ")
print("You are", age, "years old.")
Takes input and prints a message
Which of these is NOT a valid variable name in Python?
2ndgrade
What will the following code output?
name = "Alex"
print ("Hello", name)
Hello Alex
Which of these best describes a variable in Python?
A container for storing data
Which symbol is used to write comments in Python?
#
What does the (int) function do in Python?
Converts a string to an integer
What will be the output of the following code?
print(3 * "7")
777
What data type is returned by input() by default?
String
What does the print() function do?
Displays information on the screen
What is a parameter in a function?
A value or input that can be passed into the function
What is a condition?
A rule that controls whether code will run
What does it mean to 'call' a function?
Run or execute the function by its name.
Why do we define new function in Karel programs?
To make programs shorter and easier to read
what's my favorite animal?
horse