stokes.evan71
stokes.evan71 Aug 3, 2026 β€’ 20 views

Multiple Choice Questions: Python Functions for Mathematical Calculations

Hey everyone! πŸ‘‹ I'm trying to wrap my head around Python functions for math calculations, especially the `math` module. It feels like there are so many functions, and I sometimes get confused about when to use which one. Could you help me with some practice questions to solidify my understanding? I'm hoping to get better at using functions like `sqrt`, `pow`, `floor`, `ceil`, `log`, and maybe even some trigonometric ones. Thanks a bunch! πŸ™
πŸ’» Computer Science & Technology
πŸͺ„

πŸš€ Can't Find Your Exact Topic?

Let our AI Worksheet Generator create custom study notes, online quizzes, and printable PDFs in seconds. 100% Free!

✨ Generate Custom Content

1 Answers

βœ… Best Answer
User Avatar
erika832 Mar 22, 2026

πŸ“š Quick Study Guide: Python Math Functions

  • πŸ’‘ The `math` module in Python provides access to many standard mathematical functions and constants.
  • βœ”οΈ `math.sqrt(x)`: Returns the square root of `$x$`. For example, `math.sqrt(9)` is `$3.0$`.
  • πŸ”’ `math.pow(x, y)`: Returns `$x$` raised to the power of `$y$`. Equivalent to `$x^y$`. For instance, `math.pow(2, 3)` is `$8.0$`.
  • ⬇️ `math.floor(x)`: Returns the largest integer less than or equal to `$x$`. Example: `math.floor(4.7)` is `$4$`, `math.floor(-3.2)` is `$-4$`.
  • ⬆️ `math.ceil(x)`: Returns the smallest integer greater than or equal to `$x$`. Example: `math.ceil(4.1)` is `$5$`, `math.ceil(-3.9)` is `$-3$`.
  • πŸ“ `math.fabs(x)`: Returns the absolute value of `$x$` as a float. Similar to `abs()` but always returns a float. Example: `math.fabs(-5)` is `$5.0$`.
  • πŸ“ˆ `math.log(x, base)`: Returns the logarithm of `$x$` to the given `base`. If `base` is not specified, it defaults to the natural logarithm (base `$e$`). Example: `math.log(100, 10)` is `$2.0$`.
  • πŸ“ Trigonometric Functions: `math.sin(x)`, `math.cos(x)`, `math.tan(x)` take `radians` as input. `math.radians(degrees)` converts an angle from degrees to radians.
  • 🌐 `math.pi`: The mathematical constant `$\pi$` (approximately `$3.14159$`).
  • πŸ“Š `math.e`: The mathematical constant `$e$` (approximately `$2.71828$`).

🧠 Practice Quiz: Python Functions for Mathematical Calculations

Choose the best option for each question.

  1. Question 1:

    Which Python `math` module function is used to calculate the square root of a number?

    • πŸ”΅ A) `math.power()`
    • 🟒 B) `math.root()`
    • 🟑 C) `math.sqrt()`
    • 🟣 D) `math.square()`
  2. Question 2:

    What will be the output of `math.floor(4.7)`?

    • πŸ”΅ A) 4
    • 🟒 B) 5
    • 🟑 C) 4.0
    • 🟣 D) 5.0
  3. Question 3:

    Which of the following expressions correctly calculates $2^3$ using the `math` module?

    • πŸ”΅ A) `math.power(2, 3)`
    • 🟒 B) `math.pow(2, 3)`
    • 🟑 C) `math.exp(2, 3)`
    • 🟣 D) `math.exponent(2, 3)`
  4. Question 4:

    To get the natural logarithm (base $e$) of 10, which function would you use?

    • πŸ”΅ A) `math.log10(10)`
    • 🟒 B) `math.log(10, math.e)`
    • 🟑 C) `math.ln(10)`
    • 🟣 D) `math.log(10)`
  5. Question 5:

    What is the result of `math.ceil(-3.2)`?

    • πŸ”΅ A) -3
    • 🟒 B) -4
    • 🟑 C) 3
    • 🟣 D) 4
  6. Question 6:

    If you want to convert an angle of 90 degrees to radians before using a trigonometric function, which `math` module function should you use?

    • πŸ”΅ A) `math.degrees_to_radians(90)`
    • 🟒 B) `math.rad(90)`
    • 🟑 C) `math.radians(90)`
    • 🟣 D) `math.convert_to_radians(90)`
  7. Question 7:

    Which function from the `math` module returns the absolute value of a number?

    • πŸ”΅ A) `math.abs()`
    • 🟒 B) `math.absolute()`
    • 🟑 C) `math.value()`
    • 🟣 D) `math.fabs()`
Click to see Answers

1. C
2. A
3. B
4. D
5. A
6. C
7. D

Join the discussion

Please log in to post your answer.

Log In

Earn 2 Points for answering. If your answer is selected as the best, you'll get +20 Points! πŸš€