1. Home
  2. Data Science
  3. Python
  4. What does python -m http.server do?

Added 25 Nov 2026

What does python -m http.server do?

  1. Installs a web framework
  2. Runs unit tests
  3. Compiles HTTP code
  4. Starts a simple web server serving the current directory Correct answer

Correct answer

D. Starts a simple web server serving the current directory

6 views

MCQSEXAM

Explanation

The -m flag runs a module as a script; http.server is a built-in static server.

Reference

Asked in: Python Interview Basics

https://docs.python.org/3/tutorial/introduction.html

Preparing for an exam?

Doubts & discussion

Not sure why the answer is D? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Python MCQs

Practise all Python MCQs

Similar MCQs