The Wayback Machine - https://web.archive.org/web/20250329175428/https://www.geeksforgeeks.org/quizzes/miscellaneous-gq/

Python Miscellaneous

Last Updated :
Discuss
Comments

Question 1

What is the output of the following program : 

Python
print("Hello World"[::-1])
  • dlroW olleH

  • Hello Worl

  • d

  • Error

Question 2

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

  • int

  • bool

  • void

  • None

Question 3

Which module in Python supports regular expressions?

  • re

  • regex

  • pyregex

  • None of the above

Question 4

What is the output of the following program : 

Python
print(0.1 + 0.2 == 0.3)
  • True

  • False

  • Machine dependent

  • Error

Question 5

Which of the following is not a complex number?

  • k = 2 + 3j

  • k = complex(2, 3)

  • k = 2 + 3l

  • k = 2 + 3J

Question 6

What does ~~~~~~5 evaluate to?

  • +5

  • -11

  • +11

  • -5

Question 7

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

  • print s[0]

  • print s.lower()

  • s[1] = ‘r’

  • print s.strip()

Question 8

________ is a simple but incomplete version of a function.

  • Stub

  • Function

  • A function developed using bottom-up approach

  • A function developed using top-down approach

Question 9

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

  • execute python

  • go python

  • python

  • run python

Question 10

Which of the following is correct about Python?

  • It supports automatic garbage collection.

  • It can be easily integrated with C, C++, COM, ActiveX, CORBA, and Java

  • Both of the above

  • None of the above

"This course is very well structured and easy to learn. Anyone with zero experience of data science, python or ML can learn from this. This course makes things so easy that anybody can learn on their own. It's helping me a lot. Thanks for creating such a great course."-  Ayushi Jain | Placed at Microsoft

Now's your chance to unlock high-earning job opportunities as a Data Scientist! Join our Complete Machine Learning & Data Science Program and get a 360-degree learning experience mentored by industry experts.

Get hands on practice with 40+ Industry Projects, regular doubt solving sessions, and much more. Register for the Program today!

There are 10 questions to complete.

Take a part in the ongoing discussion