Python Quiz Questions and Answers

Is it possible to link a Python program to code written in C?

Answer :
  • Yes; the C code can be in a form of a dynamically or a statically linked library.

What is a correct syntax to output "Hello World" in Python?

Answer :
  • print("Hello World")

What is the correct file extension for Python files?

Answer :
  • .py

_____is interpreted.

Answer :
  • python

In Python, 'Hello', is the same as "Hello".

Answer :
  • TRUE

Which of the following is an invalid statement?

Answer :
  • x y z = 1 2 3

Which of the following cannot be a variable ?

Answer :
  • def

In Python, a variable may be assigned a value of one type, but later it can assigned a value of a different type:

Answer :
  • TRUE

Python syntax is case-sensitive.

Answer :
  • TRUE

A Python line comment begins with _____.

Answer :
  • #