Shaila B

In python, there are libraries that allow you to write your own web server in a few lines.

Simple Web Server Example

When you run this, your machine will listen on port 8000 for requests.

In a web browser, If you navigate to http://127.0.0.1:8000/

The browser will get the response as below

Using getsizeof () built-in function we can calculate memory used by an object. The standard library’s sys module provides the getsizeof () function. The sys.getsizeof () function return the size of an object in bytes.

Syntax : sys.getsizeof(object[, default])

Example: