Python Semester Independant Review Part 1

Quiz
•
Computers
•
9th Grade
•
Medium
Standards-aligned
JASON SAMMONS
Used 3+ times
FREE Resource
50 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 3 pts
What is the final result of the expression 4 + 5 * 3?
27
12
21
19
Answer explanation
To solve 4 + 5 * 3, follow the order of operations: first multiply 5 by 3 to get 15, then add 4. Thus, 4 + 15 equals 19, making 19 the correct answer.
2.
MULTIPLE CHOICE QUESTION
30 sec • 3 pts
What is the final result of the expression 7 / 2 + 6?
0
9.5
9
0.875
Answer explanation
To solve 7 / 2 + 6, first calculate 7 / 2 which equals 3.5. Then add 6: 3.5 + 6 = 9.5. Therefore, the final result is 9.5.
3.
MULTIPLE CHOICE QUESTION
30 sec • 3 pts
Choose the print statement below that will cause an error. Assume that num has the value 6, and name has the value "Isabella".
print(name + ":" )
print(num)
print(name + " wants " + "num " + "candies")
print(name + ": " + str(num))
print(name + ": " + num)
Answer explanation
The statement print(name + ": " + num) will cause an error because num is an integer and cannot be concatenated directly with strings. It needs to be converted to a string using str(num) first.
4.
MULTIPLE CHOICE QUESTION
30 sec • 3 pts
Which one of the statements below will cause an error?
ans = "hi" * 8
ans = "hi" + 9
ans = "hi" + "hi" + "hi"
ans = ("a" * 4) + "b"
Answer explanation
The statement 'ans = "hi" + 9' will cause an error because you cannot concatenate a string with an integer in Python. The other statements are valid operations.
5.
MULTIPLE CHOICE QUESTION
30 sec • 3 pts
Suppose you have a variable defined a = "4". What is the variable type of a?
str
int
float
number
Answer explanation
The variable a is defined as a string with the value '4'. In Python, enclosing a value in quotes indicates it is a string, not an integer or float. Therefore, the correct type of a is str.
6.
MULTIPLE CHOICE QUESTION
30 sec • 3 pts
Choose the option that correctly prints out the variable(s). x = "codehs" print(int(x))
The program will cause an error because "codehs" cannot be converted to an integer.
The program will print the integer value of "codehs".
The program will print "codehs" as a string.
The program will print nothing.
Answer explanation
The correct choice is that the program will cause an error because 'codehs' cannot be converted to an integer. The int() function requires a string that represents a valid integer, which 'codehs' does not.
7.
MULTIPLE CHOICE QUESTION
30 sec • 3 pts
What kind of data does a float variable contain?
Whole numbers
Words
Numbers that can have decimal components
A float is not a Python variable type
Answer explanation
A float variable in programming, including Python, is designed to store numbers that can have decimal components, making it suitable for representing fractional values. Therefore, the correct choice is 'Numbers that can have decimal components'.
Create a free account and access millions of resources
Similar Resources on Quizizz
50 questions
LATIHAN PAT INFORMATIKA KELAS X

Quiz
•
9th - 12th Grade
51 questions
N5 Computing Science: Data Types and Structures

Quiz
•
9th Grade
50 questions
Exam of the first computer CH 1 , 2

Quiz
•
9th Grade
48 questions
STARTER - 1D Array Test

Quiz
•
9th - 12th Grade
46 questions
Year 8 Mid-Term Assessment

Quiz
•
9th Grade
46 questions
Python Programming Quiz

Quiz
•
9th Grade
45 questions
Word Processing

Quiz
•
7th - 9th Grade
50 questions
General Review Grade 8

Quiz
•
7th - 12th Grade
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade
Discover more resources for Computers
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
20 questions
Taxes

Quiz
•
9th - 12th Grade
17 questions
Parts of Speech

Quiz
•
7th - 12th Grade
20 questions
Chapter 3 - Making a Good Impression

Quiz
•
9th - 12th Grade
20 questions
Inequalities Graphing

Quiz
•
9th - 12th Grade
10 questions
Identifying equations

Quiz
•
KG - University