Python

Classes and Objects

❮ Previous Next ❯ Classes and Objects Imagine you have a box. This box is special because it can hold different things like toys, books, or anything you like. In programming, we have something similar called a “class.” What is a Class? A class is like a blueprint or template. Imagine you have a blueprint […]

Classes and Objects Read More »

Python Date and Time

❮ Previous Next ❯ Python Date and Time Python’s datetime module provides functions to work with dates and times. Below are some common patterns for date and time handling in Python. The following table describes various formats with their results: Format Example Result datetime.datetime.now().strftime(‘%m/%d/%Y’) 05/29/2015 datetime.datetime.now().strftime(‘%A, %d %B %Y’) Friday, 29 May 2015 datetime.datetime.now().strftime(‘%Y-%m-%d’) 2024-07-06

Python Date and Time Read More »

Python Keywords

❮ Previous Next ❯ Python Keywords Keywords are the reserved words in python programming dedicated for a certain type of task or action. A Keyword cannot be used as a variable or a constant. Python Keywords: Keyword Description Example FALSE Represents the boolean value False. is_valid = False None Represents a null or no value.

Python Keywords Read More »

Python Dictionaries

❮ Previous Next ❯ Python Dictionaries A dictionary in Python is a collection of key-value pairs. Each key is unique, and it maps to a value. Dictionaries are mutable, meaning you can change, add, or remove items after the dictionary has been created. They are unordered, so the items in a dictionary do not maintain

Python Dictionaries Read More »

Python Sets

❮ Previous Next ❯ Python Set A set in Python is an unordered collection of unique elements. Unlike lists or tuples, sets do not allow duplicate values and do not maintain order. They are highly useful when you need to ensure that only unique items are stored, and they support operations like union, intersection, and

Python Sets Read More »

Python Tuples

❮ Previous Next ❯ Python Tuples A tuple in Python is an immutable, ordered sequence of elements. Once created, the elements within a tuple cannot be changed. Tuples are commonly used when a collection of data needs to be stored, but you don’t want it to be modified. Tuples are determined by circular brackets (

Python Tuples Read More »