Posts

Showing posts from February, 2023

Featured Post

BUILD A TODO LIST IN PYTHON

Image
Build a TODO List in Python Overview The objective is to build a todo list to which we can add items, remove the added items, edit the items and even if required, delete out the entire list itself. We will learn here step by step, how to build the todo list with the above  CRUD (Create, Remove, Update/edit, and Delete ) features.  This is a CRUD list  app  that we are building as we can Create, Remove, Update items in the list and Delete the entire list itself. We will be using Python3 to build this Project. Importing os and time We import time to let the screen pause for a while before clearing  and we import os to clear the screen . Initializing the list We initialize the todo list with an empty list as there are not items added yet to the list and this is represented in the code aby using an empty square braces   toDoList = [] Defining the print list  The def keyword is used to define a function in python. In the below code, we define the function called printList(). When we define

A Simple Guide to Python Lists

A Simple Guide to Python Lists What are Lists  Lists in Python are built-in data structures to store items in a specified order. Lists store multiple items in a single variable. Sometimes, they could also be not carrying any item, that is, they could be empty as well.  Let us delve deeper into the concept of lists, how they are created and what methods we can perform with lists. Define Lists  Lists are built-in data structures  in Python, that store multiple items with a specified order, in a single variable. How to Create a List To create a list, for example , below, we use a variable called names and store all strings, namely, "Jay", "Ann" and "Alan" using the square brackets and then we run the print command. We also consider another variable numbers storing numbers 1,2,3  as shown below. names = ["Jay","Ann","Alan"] print(names) numbers = [1,2,3] print(numbers)   What are List Items The list items could be o