bugl
bugl
HomeLearnPatternsSearch
HomeLearnPatternsSearch

Loading lesson path

Learn/Python

Python

Files, Modules, and the Standard Library

Work with files, import code cleanly, and use Python’s built-in modules without guessing.

Lesson 1

Python File Open

File handling is an important part of any web application. Python has several functions for creating, reading, updating, and deleting files. File Handling The key function for working with files in P…

2 min
Read lesson →
Lesson 2visual

Python Python Built-in Modules

This page lists the built-in modules that ship with the Python 3.13 Standard Library. These modules are available without extra installation (some are platform-dependent). A Module Description Introd…

10 min
Read lesson →
Lesson 3visual

How to Remove Duplicates From a Python List

How to Remove Duplicates From a Python List

2 min
Read lesson →
Lesson 4

Python File Open

Open a File on the Server Assume we have the following file, located in the same folder as Python: demofile.txt Hello! Welcome to demofile.txt This file is for testing purposes. Good Luck! To open th…

2 min
Read lesson →
Lesson 5visual

Python Random Module

Python has a built-in module that you can use to make random numbers. The random module has a set of methods: Method Description seed() Initialize the random number generator getstate() Returns the c…

2 min
Read lesson →
Lesson 6

How to Reverse a String in Python

How to Reverse a String in Python

2 min
Read lesson →
Lesson 7

Python File Write

Write to an Existing File To write to an existing file, you must add a parameter to the open() function: "a" - Append - will append to the end of the file "w" - Write - will overwrite any existing co…

2 min
Read lesson →
Lesson 8visual

Python Requests Module

Example Make a request to a web page, and print the response text: import requests x = requests.get('https://w3schools.com/python/demopage.htm') print(x.text) Definition and Usage The requests module…

2 min
Read lesson →
Lesson 9

How to Add Two Numbers in Python

How to Add Two Numbers in Python

2 min
Read lesson →
Lesson 10

Python Delete File

Delete a File To delete a file, you must import the OS module, and run its os.remove() function: Example Remove the file "demofile.txt": import os os.remove("demofile.txt") Check if File exist: To av…

2 min
Read lesson →
Lesson 11visual

Python statistics Module

Python statistics Module Python has a built-in module that you can use to calculate mathematical statistics of numeric data. The statistics module was new in Python 3.4. Statistics Methods Method Des…

2 min
Read lesson →
Lesson 12visual

Python math Module

Python math Module Python has a built-in module that you can use for mathematical tasks. The math module has a set of methods and constants. Math Methods Method Description math.acos() Returns the ar…

3 min
Read lesson →
Lesson 13visual

Python cmath Module

Python cmath Module Python has a built-in module that you can use for mathematical tasks for complex numbers. The methods in this module accepts int, float, and complex numbers. It even accepts Pytho…

2 min
Read lesson →