Python Tutorials

Latest

 thumbnail

How To Terminate A Python Script

June 03, 2021

The easiest way to terminate a Python script is to raise a new SystemExit exception. When you raise a SystemExit excepti...

 thumbnail

How to Create a Python List of Dictionaries

May 28, 2021

To create a list of dictionaries in Python, pass them as a comma-separated list inside [] (square brackets) and store th...

 thumbnail

Python If with NOT Statements

May 28, 2021

An if NOT statement in Python will only execute code inside the block if the boolean value supplied is False, or an iter...

 thumbnail

How to Convert Python List to JSON

May 28, 2021

To convert a Python list into JSON format, import the json package and call the dumps() function, passing the list to pa...

 thumbnail

How to Get Index/Position of Item in Python List

May 28, 2021

To get the position of an element in a Python list, use the index() function. Pass .index() after the list to evaluate a...