Python Tutorials

Python Convert List to Dictionary: A Complete Guide

You can convert a Python list to a dictionary using a dictionary comprehension, dict.fromkeys(), or the zip() method. All three methods create a new dictionary. They do not modify the existing list. Python lists and dictionaries are two structures used…

Replace Item in List in Python: A Complete Guide

There are three ways to replace an item in a Python list. You can use list indexing or a for loop to replace an item. If you want to create a new list based on an existing list and make…

Python Dictionary Values: A Guide

The Python dictionary values() method returns an object containing the values in a dictionary. This method is useful if you want to iterate over only the values in the dictionary. If you change a dictionary later, the data stored in…

Python Move File: A Complete Guide

The Python shutil.move() method moves a file to another location on your computer. This method is part of the shutil model, which you must import before using this method. Moving files is a common operation in Python programs. For instance,…

Python Shuffle List: A Step-By-Step Guide

The Python random.shuffle() method changes the order of the items in a list at random. Combined with indexing, this method is useful for selecting a random item from a list. The random.shuffle() method accepts one argument: the list you want…

Python Power: A Step-By-Step Guide

The ** operator and the pow() function calculate the power of a number in Python. The ** operator raises the number on the left to the power of the number on the right. The pow() function raises the first parameter…

Python Ord: A Step-By-Step Guide

The Python ord() method converts a character into its Unicode code. The ord() method takes one argument: a string containing a single Unicode character. This method returns an integer that represents that character in Unicode. You may encounter a situation…

How to Write a Python Insertion Sort

The Python insertion sort works like sorting game cards. To use the insertion sort, you create two lists: a sorted and unsorted list. You compare each item in the unsorted list until you sort that item. The insertion sort is…

How to Use the Python Modulo Operator

The Python modulo operator calculates the remainder of dividing two values. This operator is represented by the percentage sign (%). The syntax for the modulo operator is: number1 % number2. The first number is divided by the second then the…

How to Copy a List in Python

You can copy a list in Python using the copy() method, slicing, the list() method, and a list comprehension. The copy() method is the most direct way of copying a Python list. When you’re working with a list in Python,…

Get matched modal

Find the best bootcamp for you

Our matching algorithm will connect you to job training programs that match your schedule, finances, and skill level.