No student devices needed. Know more
31 questions
What is the difference between a binary operator and a unary operator?
A computer can use binary operators, but it cannot use unary operators.
A unary operator needs two things, while a binary operator only needs one.
A binary operator needs two things, while a unary operator only needs one.
Binary operators are used for arithmetic expressions, while unary operators are for strings.
What is the output of the following program? Assume the user enters “Brendan”, then “Aydt”.
Aydt Brendan
Brendan
Aydt
BrendanAydt
Brendan Aydt
True or false: In order to print a string literal, the string must be enclosed in quotes.
True
False
True or false: Print statements will not let you print strings and numbers in the same statement.
True
False
True or false: Each print statement will be printed on its own line.
True
False
Which of the following choices is a properly formed Python variable name, meaning it is both legal in the Python language and considered good style?
word_to_find
word to find
Word!To!Find
9word_to_find
Which of the following choices is NOT a Python variable type?
int
str
float
number
What is the final result of the expression 5 - 7 * 2?
-9
-4
5
4
What is the final result of the expression 13 / 4 + 7?
10
10.33333333
error
8
Which one of the statements below will cause an error?
var = “Aydt” * 10
var = “Aydt” + 5
var = “Aydt” + "Aydt"
var = (“x” * 3) + “y”
If x = "syzygy" and y = 4, what type will z = x * y have?
No type; this variable assignment is illegal.
str
float
int
Explore all questions with a free account