OXALLY INTERACTIVE
Python Fundamentals Quiz: 21 Video Review
Progress0/102
Python Fundamentals: Comprehensive Review
Answer the following questions using only concepts demonstrated in the 21-video course sequence.
1. Getting Started with Python
1.What is the role of the Python interpreter described in the video?
2.Python source files end with the _____ file extension.
3.Which symbol begins a comment in the demonstrated Python code?
2. Variables and Data Types
4.A variable is described as a container for what?
5.Which data type is appropriate for a value such as 10.99?
6.In an f-string, curly braces are used to insert a variable into the text.
7.Why should a whole-number age such as 25 be written without quotes when it is intended to be an integer?
8.Which pair represents the two Boolean values shown in the lesson?
9.What is the difference between printing a variable name without quotes and putting that name in quotes?
3. Type Casting
10.In the lesson, why should a numeric value entered by a user be cast before doing arithmetic with it?
11.What happens when the video casts a floating-point value such as 1.9 to int?
12.According to the lesson, converting a nonzero number to bool gives True, while zero gives False.
13.Which description matches implicit type casting in the lesson?
14.In the lesson's Boolean-casting example, what does bool() return for an empty string, and what does it return for a string containing a space?
4. User Input and Small Programs
15.Which function does the lesson use to accept input from the user?
16.Why does the lesson type-cast length and width before calculating a rectangle's area?
17.In the shopping-cart program, which type is used for the price and which type is used for the quantity?
18.In the rectangle exercise, area is calculated as length _____ width.
19.Which built-in function does the lesson use to round the shopping-cart total to two decimal places?
5. Math Operators and Functions
20.What does the modulus operator (%) return?
21.Which operator is used for exponentiation in the demonstrated Python code?
22.The max() function can find the maximum value among several values.
23.What must be done before using pi or the square-root function from the math module as demonstrated?
24.How do math.ceil() and math.floor() behave in the lesson?
25.According to the final exercise, what is the hypotenuse when side A is 3 and side B is 4?
6. If Statements
26.What must be true for code indented beneath an if statement to run?
27.Why does the video recommend placing the age-at-least-100 check before the age-at-least-18 check?
28.Which operator does the lesson use to compare two values for equality?
29.The video demonstrates using a Boolean variable directly as the condition in an if statement.
7. Calculator Program
30.Why did adding user-entered 10 and 11 initially produce 101 in the calculator lesson?
31.Which operator string is used for multiplication in the calculator's selection logic?
32.How can the calculator round a result to three digits after the decimal point?
33.What should the calculator do when a user enters an unsupported operator such as “Pizza”?
8. Weight Conversion Exercise
34.Which input letters does the demonstrated converter expect for kilograms and pounds?
35.When the input unit is K, what conversion does the program perform?
36.What does the program do when the unit input is L?
37.The exercise converts the user's weight input to a floating-point number before performing the conversion.
38.How does the revised program handle an invalid unit such as “pizzas”?
9. Temperature Conversion Program
39.Why is the entered temperature cast to a float?
40.Which formula does the lesson use to convert Celsius to Fahrenheit?
41.Which formula does the lesson use to convert Fahrenheit to Celsius?
42.What happens when the user enters K as the unit?
43.What Fahrenheit result does the demonstrated program produce for 33°C?
10. Logical Operators
44.For the expression temp > 0 and temp < 30, when is the entire condition true?
45.For temp <= 0 or temp >= 30, what is the minimum needed for the whole condition to be true?
46.If sunny is False, what does not sunny evaluate to?
11. Conditional Expressions
47.What is a conditional expression in Python?
48.Which pattern matches the formula taught for a conditional expression?
49.In the even-or-odd example, which condition identifies an even number?
50.Given a = 6 and b = 7, what does the expression a if a > b else b return?
51.What access level is produced when user_role is "guest" in the lesson's final example?
12. String Methods
52.What does len() return for a string?
53.What does find() return if it cannot locate the requested character?
54.Which rules are imposed on a valid username in the exercise? Select all that apply.
55.Which method returns True only when a string contains digits only?
56.How does the lesson remove all dashes from a phone-number string?
13. String Indexing
57.What is the index of the first character in a Python string?
58.In a slice such as text[0:4], the start index is inclusive and the end index is exclusive.
59.Which slice selects the last four characters of a string?
60.What does text[::2] do?
61.To reverse an entire string with slicing, use a step of _____.
14. Email Slicer Program
62.What does email.index("@") return in the demonstrated program?
63.If index stores the position of @, which slice extracts the username?
64.Why does the domain slice begin at index + 1?
65.The instructor says directly repeating the index() call can reduce the number of lines, but storing it in a variable may be more readable.
15. Format Specifiers
66.In an f-string placeholder, what follows the value when adding format specifiers?
67.What does .2f do in the demonstrated format specifier?
68.Which symbol centers a value in the allocated space?
69.Which effects are demonstrated as format-specifier options? Select all that apply.
16. While Loops
70.When does a while loop continue executing its body?
71.Why must the name-validation loop prompt the user for a new name inside the loop?
72.In the food example, what input ends the loop?
73.Which condition identifies values outside the allowed range from 1 through 10?
74.How does a while loop differ from the if statement in the lesson's first example?
17. Compound Interest Calculator
75.Which three inputs does the calculator ask the user to provide? Select all that apply.
76.Why is the time input cast to int in the first version?
77.Which expression represents the compound-interest calculation taught in the video?
78.Why did changing the validation condition from <= 0 to < 0 cause the initial loops to be skipped?
79.A while True loop continues indefinitely unless the program explicitly exits it, such as with break.
18. For Loops
80.When does the video suggest preferring a for loop over a while loop?
81.Which range counts from 1 through 10?
82.What values are produced by range(1, 11, 2)?
83.What is the difference between continue and break?
19. Nested Loops
84.What is a nested loop?
85.If the outer loop runs 3 times and the inner loop runs 9 times per outer iteration, how many inner-loop iterations occur in total?
86.In the rectangle project, which loop controls the rows and which controls the columns?
87.Why is an empty print() placed inside the outer loop but outside the inner loop?
88.A nested-loop pair may combine different loop types, such as a while loop inside a for loop.
20. Countdown Timer Program
89.What does time.sleep(3) do?
90.Which range configuration counts backward from my_time to 1?
91.Why is seconds calculated as x % 60?
92.How is the timer's minutes component calculated?
93.Why does the program not apply % 24 to the hours field?
21. Lists, Sets, and Tuples
94.Which delimiters are used for the three collections taught? Select all correct matches.
95.What happens when code tries to access index 4 in a four-element list?
96.Which statement correctly describes lists?
97.Which list-method behaviors are taught? Select all that apply.
98.Why can a set not be accessed by numeric index in the lesson?
99.Adding a duplicate value to a set results in only one copy of that value remaining in the set.
100.Which statement correctly describes tuples according to the lesson?
101.What does the in operator return when checking whether a value belongs to a collection?
Quiz Note
Correction for the earlier calculator item: the concatenation example uses the entries 10 and 1, producing the string 101 before numeric type casting. Use the corrected item below in place of the earlier version.