and Answers Rated A+
What happens if you divide by zero in Python?
✔✔It raises a `ZeroDivisionError`.
What is type conversion in Python?
✔✔Type conversion is the process of changing a value from one data type to another, such as
from a string to an integer.
What is the purpose of the `+` operator for strings in Python?
✔✔The `+` operator is used to concatenate strings.
What is a syntax error in Python?
✔✔A syntax error occurs when the code does not follow Python's rules for writing statements.
What is the result of `5 * (2 + 3)` in Python?
✔✔The result is `25` because parentheses change the order of operations.
1
, How do you include a quote inside a string in Python?
✔✔You can include a quote by using the opposite type of quotes to enclose the string, or by
escaping it with a backslash (`"He said 'hello'"` or `'It\'s a test'`).
What is a floating-point number?
✔✔A floating-point number is a number that has a decimal point, like `3.14`.
What does the `-` operator do in Python?
✔✔The `-` operator performs subtraction.
What is the difference between `` and `5 // 2` in Python?
✔✔`` returns `2.5` as a float, while `5 // 2` returns `2` as an integer.
How do you indicate the end of a line of code in Python?
✔✔In Python, the end of a line is indicated by pressing Enter, as Python uses line breaks to
determine the end of statements.
What does it mean for Python to be an interpreted language?
2