55284A: Introduction to Python Quiz Questions and Answers

Which of the following is correct about Python?

Answer :
  • Both of the above

To start Python from the command prompt, use the command ______.

Answer :
  • Python

Given a string s = “Welcome”, which of the following code is incorrect?

Answer :
  • s[1] = 'r'

Given a function that does not return any value, what value is shown when executed at the shell?

Answer :
  • None of the above

Which of these is not a core data type?

Answer :
  • Class

What data type is the object below ? L = [1, 23, ‘hello’, 1]

Answer :
  • Lists

Which of the following function convert a string to a float in Python?

Answer :
  • float(x)

Which of the following is an invalid statement?

Answer :
  • x y z = 1 2 3

Operators with the same precedence are evaluated in which manner?

Answer :
  • Left to Right

What will be the output of the following Python code snippet? print('The sum of {0:b} and {1:x} is {2:o}'.format(2, 10, 12))

Answer :
  • The sum of 10 and a is 14