Quiz: Python Part-1

To View Tricks: Login Required

Number of Questions: 37

Question: 11 -

Which of the following statements is correct for variable names in Python language?

Options:
  1. All of the above

  2. Unlimited length

  3. All variable names must begin with an underscore.

  4. The variable name length is a maximum of 2.

  5. Answer:

    Unlimited length

    Solution not available.

Question: 12 -

Which of the following is not a keyword in Python language?

Options:
  1. try

  2. with

     

  3. val

  4. raise

  5. Answer:

    val

    Solution not available.

Question: 13 -

Which of the following operators is the correct option for power(ab)?

Options:
  1. a ^ ^ b

  2. a ^ b

  3. a ^ * b

  4. a**b

  5. Answer:

    a**b

    Solution:

    The power operator in python is a**b, i.e., 2**3=8.


Question: 14 -

Which of the following declarations is incorrect in python language?

Options:
  1. x,y,z,p = 5000, 6000, 7000, 8000

  2. x_y_z_p = 5,000,000

  3. xyzp = 5,000,000

  4. x y z p = 5000 6000 7000 8000

  5. Answer:

    x y z p = 5000 6000 7000 8000

    Solution:

    Spaces are not allowed in variable names.


Question: 15 -

Which of the following words cannot be a variable in python language?

Options:
  1. val

  2. try

  3. _try_

  4. _val

  5. Answer:

    try

    Solution:

    "try" is a keyword.