Python Numbers

    Last Updated :
    Discuss
    Comments

    Question 1

    What is the output of print(type(5))?

    • <class 'int'>

    • <class 'float'>

    • <class 'str'>

    • <class 'num'>

    Question 2

    What type of number is 3.14 in Python?

    • Integer

    • Complex

    • Float

    • String

    Question 3

    How to express the number 5 raised to the power 2 in Python?

    • 5 * 5

    • 5 ** 2

    • 5 ^ 2

    • 2**5

    Question 4

    What will be the result of the operation (1 + 2j) * (3 + 4j)?

    • -5 + 10j

    • 11 + 10j

    • 10 + 11j

    • -10 + 11j

    Question 5

    Which function in Python can convert the string '123' to the integer 123?

    • str(123)

    • int('123')

    • float('123')

    • convert('123')

    Question 6

    What is the result of 10 % 3?

    • 3.33

    • 1

    • 0.33

    • 3

    Question 7

    How can you express one million as a literal in Python?

    • 1,000,000

    • 1000000

    • 1_000_000

    • B and C

    Question 8

    Which function will you use to find the absolute value of a number in Python?

    • abs()

    • fabs()

    • absolute()

    • all()

    Question 9

    Which of the following is used to represent infinity in Python?

    • inf

    • infinity

    • float('inf')

    • None of the above

    Question 10

    How to find the base-2 logarithm of 16 in Python?

    • math.log2(16)

    • math.log(16, 2)

    • math.ln(16)

    • Both A and B

    There are 10 questions to complete.

    Take a part in the ongoing discussion