Clear, practical technology insights BSOD Code Lookup · Windows Error Code Lookup · Wi-Fi Troubleshooting · PC Troubleshooting Checklist

Multiple Choice Quiz About Python - Part 6

Review Multiple Choice Quiz About Python - Part 6 with focused questions, clear answer guidance, and practical takeaways to strengthen your understanding.

Table of Contents

This article presents Multiple Choice Quiz About Python - Part 6 in a clear, structured format. It helps readers review key concepts, test their understanding, and learn from the material.

Understanding Multiple Choice Quiz About Python

  • Question 1: Which of the following functions is a built-in function in Python.
    • seed ()
    • sqrt ()
    • factorial ()
    • print ()
    Explanation: seed () is a random module function, sqrt () and factorial () of the math module and print () is a built-in function that prints a value directly at the system output.
  • Question 2: What is the result of the following expression?
    round (4.576)
    • 4.5
    • 5
    • 4
    • 4.6
    Explanation: round () is a built-in function to round decimal numbers. The above expression does not specify the decimal place to be rounded up so the default program rounds to an integer, so the output here is 5.
  • Question 3: The function pow (x, y, z) is interpreted as:
    • (x ** y) ** z
    • (x ** y)/z
    • (x ** y)% z
    • (x ** y) * z
    Explanation: The built-in function pow () can have two or three parameters. If pow () has only two parameters, they are interpreted as (x ** y), and in the case of three parameters, the result is (x ** y)% z.
  • Question 4: What is the result of the following function?
    all ([2,4,0,6])
    • Lỗi
    • True
    • False
    • 0
    Explanation: The all () function returns False when one of the iterable elements is 0 and returns True if they are different from 0. Therefore the output of this expression is False.
  • Question 5: What is the result of the following expression?
    round (4.5676,2)
    • 4.5
    • 4.6
    • 4.57
    • 4.56
    Explanation: The round () function is used to round the decimal point to the specified decimal place. In this case, the number must be rounded to two decimal places so the output will be 4.57.
  • Question 6: What is the output of the following function?
    any ([2>8, 4>2, 1>2])
    • Lỗi
    • True
    • False
    • 4> 2
    Explanation: Any () function returns True if any element of an iterable is True (different from 0). If no True element is present, any () function will return False.
  • Question 7: What is the output of the representation function below?
    import math
    abs (math.sqrt (25))
    • Lỗi
    • -5
    • 5
    • 5.0
    Explanation: The abs () function returns the absolute value of the passed argument. For example: abs (-5) = 5. Therefore, in this case, abs (5.0) = 5.0.
  • Question 8: What are the results of the function shown below?
    sum (2,4,6)
    sum ([1,2,3])
    • Error, 6
    • 12, Error
    • 12, 6
    • Lỗi, Lỗi
    Explanation: The first function will have an error because sum () is used to find the sum of iterable numbers. Therefore, the result will be Error and 6 respectively.
  • Question 9: Output of the following function is:
    all (3,0,4.2)
    • True
    • False
    • Lỗi
    • 0
    Explanation: The all () function returns True when iterable elements are different from zero. In the above case, the values are not iterable, so an error will occur.
  • Question 10: What is the result of the following expression?
    min (max (False,-3,-4), 2,7)
    • 2
    • False
    • -3
    • -4
    Explanation: The max () function is used to find the maximum value in three values -3, -4 and false. 'false' is treated as a value of 0, so the other expression is min (0, 2, 7), so the result will be 0 (false)

FAQ

What is the main point of Multiple Choice Quiz About Python - Part 6?

Question 1: Which of the following functions is a built-in function in Python. seed () sqrt () factorial () print () Explanation: seed () is a random module function, sqrt () and factorial () of the math module and print () is a built-in function that prints a value directly at.

Why is Multiple Choice Quiz About Python - Part 6 important?

Multiple Choice Quiz About Python - Part 6 matters because it can affect how readers understand, choose, use, or respond to the subject discussed in the article.

What should readers verify about Multiple Choice Quiz About Python - Part 6?

Check the date, product or software version, compatibility, and any current guidance before acting, especially when technology, security, health, or pricing is involved.

Discussion

Reader Comments 0

Sign in with email or Google to join the discussion.