55285A: Advanced Python Quiz Questions and Answers

Which Data Type in Python maintains data in the form of Key-Value Pairs?

Answer :
  • Dictionary

What will be the result of : print(2^6)

Answer :
  • 4

What will be the result of : x = 100 print(~x)

Answer :
  • -101

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 the correct file extension for Python files?

Answer :
  • .py

Which of the following is an invalid statement?

Answer :
  • x y z = 1 2 3

How do you insert comments in Python code?

Answer :
  • #This is a comment

A Python line comment begins with _____.

Answer :
  • #

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

Answer :
  • print( "Hello World ")

A _____ error does not cause the program to abort but produces incorrect results.

Answer :
  • logical