55284A: Introduction to Python Quiz Questions and Answers

What is the output of the following code: L = ['a','b','c','d'] print(" ".join(L))

Answer :
  • abcd

What is the output of the following segment : chr(ord('A'))

Answer :
  • A

Suppose list1 is [3, 4, 5, 20, 5, 25, 1, 3], what is list1 after list1.pop(1)?

Answer :
  • [3, 5, 20, 5, 25, 1, 3]

time.time() returns ________.

Answer :
  • the current time in milliseconds since midnight, January 1, 1970 GMT (the Unix time)

Which of the following is the use of id() function in Python?

Answer :
  • Id returns the identity of the object

What is called when a function is defined inside a class?

Answer :
  • Method

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