The Wayback Machine - https://web.archive.org/web/20240930232935/https://www.geeksforgeeks.org/python-cheat-sheet/
Open In App

Python Cheat sheet (2024)

Last Updated : 30 Apr, 2024
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

Python is one of the most widely-used and popular programming languages, was developed by Guido van Rossum and released first in 1991. Python is a free and open-source language with a very simple and clean syntax which makes it easy for developers to learn Python. It supports object-oriented programming and is most commonly used to perform general-purpose programming. Python is used in several domains like Data Science, Machine Learning, Deep Learning, Artificial Intelligence, Scientific Computing Scripting, Networking, Game Development Web Development, Web Scraping, and various other domains.

python-cheat-sheet

Python Cheat Sheet

To give a comprehensive overview of Python programming, we made a Python Cheat Sheet for Python programmers. In this Cheat Sheet of Python, you’ll learn all the basic to advanced topics and concepts of Python, like Python data types, Python for loop, Python slice, python map function, python dictionary, Python File Handling, etc.

What is Python?

Python is one of the most widely-used and popular programming languages, was developed by Guido van Rossum and released first on February 20, 1991. Python is a free and open-source language with a very simple and clean syntax which makes it easy for developers to learn Python. It supports object-oriented programming and is most commonly used to perform general-purpose programming. Python is used in several domains like Data Science, Machine Learning, Deep Learning, Artificial Intelligence, Scientific Computing Scripting, Networking, Game Development Web Development, Web Scraping, and various other domains.

Python Program to Print Hello world

The print() function in Python is used to print Python objects as strings as standard output.

Python3
# python program to print "Hello World"
print("Hello World")

Output:

Hello World

Python end parameter in print()

The keyword end can be used to avoid the new line after the output or end the output with a different string.

Python3
# ends the output with a space
print("Welcome to", end=' ')
print("GeeksforGeeks", end=' ')

Output:

Welcome to GeeksforGeeks 

Python sep parameter in print()

The separator between the inputs to the print() method in Python is by default a space, however, this can be changed to any character, integer, or string of our choice. The ‘sep’ argument is used to do the same thing.

Python3
# code for disabling the softspace feature
print('09', '12', '2016', sep='-')

# another example
print('Example', 'geeksforgeeks', sep='@')

Output:

09-12-2016
Example@geeksforgeeks

Python Input

The input() method in Python is used to accept user input. By default, it returns the user input as a string. By default, the input() function accepts user input as a string.

Python3
# Python program showing
# a use of input()
 
val = input("Enter your value: ")
print(val)

Output:

Enter your value: Hello Geeks
Hello Geeks

Operators in Python

In general, Operators are used to execute operations on values and variables. These are standard symbols used in logical and mathematical processes.

Arithmetic Operators

Python Arithmetic Operators are used to perform mathematical operations like addition, subtraction, multiplication, and division.

Python3
# Examples of Arithmetic Operator
a = 9
b = 4

# Addition of numbers
add = a + b

# Subtraction of numbers
sub = a - b

# Multiplication of number
mul = a * b

# Modulo of both number
mod = a % b

# Power
p = a ** b

# print results
print(add)
print(sub)
print(mul)
print(mod)
print(p)

Output:

13
5
36
1
6561

Comparison Operators

When comparing values, relational operators are utilized. Depending on the criteria, it returns True or False. Comparison Operators are another name for these operators.

Python3
# Examples of Relational Operators
a = 13
b = 33

# a > b is False
print(a > b)

# a < b is True
print(a < b)

# a == b is False
print(a == b)

# a != b is True
print(a != b)

# a >= b is False
print(a >= b)

# a <= b is True
print(a <= b)

Output:

False
True
False
True
False
True

Logical Operators in Python

Logical operators are used on conditional statements in Python (either True or False). They conduct the logical AND, OR, and NOT operations.

Python3
# Examples of Logical Operator
a = True
b = False

# Print a and b is False
print(a and b)

# Print a or b is True
print(a or b)

# Print not a is False
print(not a)

Output:

False
True
False

Bitwise Operators in Python

Bitwise operators are used in Python to do bitwise operations on integers. After converting the numbers to binary, operations are done on each bit or corresponding pair of bits, hence the name bitwise operators.

Python3
# Examples of Bitwise operators
a = 10
b = 4

# Print bitwise AND operation
print(a & b)

# Print bitwise OR operation
print(a | b)

# Print bitwise NOT operation
print(~a)

# print bitwise XOR operation
print(a ^ b)

# print bitwise right shift operation
print(a >> 2)

# print bitwise left shift operation
print(a << 2)

Output:

0
14
-11
14
2
40

Python Comment

Comments in Python are the lines in the code that are ignored by the interpreter during the execution of the program. There are three types of comments in Python:

  • Single line Comments
  • Multiline Comments
  • Docstring Comments
Python3
# Single Line comment

# Python program to demonstrate
# multiline comments

""" Python program to demonstrate
 multiline comments"""

name = "geeksforgeeks"
print(name)

Output:

geeksforgeeks

DataType in Python

The type() function can be used to define the values of various data types and to check their data types.

Python3
# DataType Output: str
x = "Hello World"

# DataType Output: int
x = 50

# DataType Output: float
x = 60.5

# DataType Output: complex
x = 3j

# DataType Output: list
x = ["geeks", "for", "geeks"]

# DataType Output: tuple
x = ("geeks", "for", "geeks")

# DataType Output: range
x = range(10)

# DataType Output: dict
x = {"name": "Suraj", "age": 24}

# DataType Output: set
x = {"geeks", "for", "geeks"}

# DataType Output: frozenset
x = frozenset({"geeks", "for", "geeks"})

# DataType Output: bool
x = True

# DataType Output: bytes
x = b"Geeks"

# DataType Output: bytearray
x = bytearray(4)

# DataType Output: memoryview
x = memoryview(bytes(6))

# DataType Output: NoneType
x = None

List in Python

The Python list is a sequence data type that is used to store the collection of data. Tuples and String are other types of sequence data types.

Python3
Var = ["Geeks", "for", "Geeks"]
print(Var)

Output:

['Geeks', 'for', 'Geeks']

List comprehension

A Python list comprehension is made up of brackets carrying the expression, which is run for each element, as well as the for loop, which is used to iterate over the Python list’s elements.

Also, Read – Python Array

Python3
# Using list comprehension to iterate through loop
List = [character for character in [1, 2, 3]]

# Displaying list
print(List)

Output:

[1, 2, 3]

Dictionary in Python 

A dictionary in Python is a collection of key values, used to store data values like a map, which, unlike other data types holds only a single value as an element.

Python3
Dict = {1: 'Geeks', 2: 'For', 3: 'Geeks'}
print(Dict)

Output:

{1: 'Geeks', 2: 'For', 3: 'Geeks'}

Python Dictionary Comprehension

Like List Comprehension, Python allows dictionary comprehension. We can create dictionaries using simple expressions. A dictionary comprehension takes the form {key: value for (key, value) in iterable}

Python3
# Lists to represent keys and values
keys = ['a','b','c','d','e']
values = [1,2,3,4,5]

# but this line shows dict comprehension here
myDict = { k:v for (k,v) in zip(keys, values)}

# We can use below too
# myDict = dict(zip(keys, values))

print (myDict)

Output:

{'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5}

Tuples in Python

Tuple is a list-like collection of Python objects. A tuple stores a succession of values of any kind, which are indexed by integers.

Python3
var = ("Geeks", "for", "Geeks")
print(var)

Output:

('Geeks', 'for', 'Geeks')

Sets in Python

Python Set is an unordered collection of data types that can be iterated, mutated and contains no duplicate elements. The order of the elements in a set is unknown, yet it may contain several elements.

Python3
var = {"Geeks", "for", "Geeks"}
print(var)

Output:

{'for', 'Geeks'}

Python String

In Python, a string is a data structure that represents a collection of characters. A string cannot be changed once it has been formed because it is an immutable data type.

Creating and Accessing String

Strings in Python can be created using single quotes or double quotes or even triple quotes. In Python, individual characters of a String can be accessed by using the method of Indexing. Indexing allows negative address references to access characters from the back of the String.

Python3
String1 = "GeeksForGeeks"
print("Initial String: ")
print(String1)

# Printing First character
print("\nFirst character of String is: ")
print(String1[0])

# Printing Last character
print("\nLast character of String is: ")
print(String1[-1])

Output:

Initial String: 
GeeksForGeeks
First character of String is:
G
Last cha racter of String is:
s

String Slicing

Strings in Python can be constructed with single, double, or even triple quotes. The slicing method is used to access a single character or a range of characters in a String. A Slicing operator (colon) is used to slice a String.

Python3
# Creating a String
String1 = "GeeksForGeeks"
print("Initial String: ")
print(String1)

# Printing 3rd character
print("\nSlicing characters from 3-12: ")
print(String1[3])

# Printing characters between
# 3rd and 2nd last character
print("\nSlicing characters between " +
    "3rd and 2nd last character: ")
print(String1[3:-2])

Output:

Initial String: 
GeeksForGeeks

Slicing characters from 3-12:
k

Slicing characters between 3rd and 2nd last character:
ksForGee

Conditional Statements

Decision-making statements in programming languages decide the direction(Control Flow) of the flow of program execution. 

Python If-Else

In a conditional if Statement the additional block of code is merged as an else statement which is performed when if condition is false. 

Python3
# python program to illustrate If else statement

i = 20
if (i < 15):
    print("i is smaller than 15")
else:
    print("i is greater than 15")
print("i'm not in if and not in else Block")

Output:

i is greater than 15
i'm not in if and not in else Block

Python For Loop

The Python For loop is used for sequential traversal, that is, iterating over an iterable such as a String, Tuple, List, Set, or Dictionary. For loops in Python only support collection-based iteration.

Python3
# Python program to illustrate
# Iterating over a list
l = ["geeks", "for", "geeks"]

for i in l:
    print(i)

Output:

geeks
for
geeks

Python While Loop

The Python while Loop is used to execute a set of statements repeatedly until a condition is met. When the condition is met, the line immediately following the loop in the program is run.

Python3
# Python program to illustrate
# while loop
count = 0
while (count < 3):
    count = count + 1
    print("Hello Geek")

Output:

Hello Geek
Hello Geek
Hello Geek

For more read, refer this break, continue, and pass in Python

Python Functions

Python Functions are a collection of statements that serve a specific purpose. The idea is to bring together some often or repeatedly performed actions and construct a function so that we can reuse the code included in it rather than writing the same code for different inputs over and over.

Python3
# A simple Python function
def fun():
    print("Welcome to GFG")

# Driver code to call a function
fun()

Output:

Welcome to GFG

Function Arguments

Arguments are the values given between the function’s parenthesis. A function can take as many parameters as it wants, separated by commas.

Python3
# A simple Python function to check
# whether x is even or odd
def evenOdd(x):
    if (x % 2 == 0):
        print("even")
    else:
        print("odd")


# Driver code to call the function
evenOdd(2)
evenOdd(3)

Output:

even
odd

Return Statement in Python Function

The function return statement is used to terminate a function and return to the function caller with the provided value or data item.

Python3
# Python program to
# demonstrate return statement
def add(a, b):

    # returning sum of a and b
    return a + b

def is_true(a):

    # returning boolean of a
    return bool(a)

# calling function
res = add(2, 3)
print("Result of add function is {}".format(res))

res = is_true(2<5)
print("\nResult of is_true function is {}".format(res))

Output:

Result of add function is 5

Result of is_true function is True

The range() function

The Python range() function returns a sequence of numbers, in a given range.

Python3
# print first 5 integers
# using python range() function
for i in range(5):
    print(i, end=" ")
print()

Output:

0 1 2 3 4 

*args and **kwargs in Python

The *args and **kwargs keywords allow functions to take variable-length parameters. The number of non-keyworded arguments and the action that can be performed on the tuple are specified by the *args.**kwargs, on the other hand, pass a variable number of keyword arguments dictionary to function, which can then do dictionary operations.

Python3
def myFun(arg1, arg2, arg3):
    print("arg1:", arg1)
    print("arg2:", arg2)
    print("arg3:", arg3)


# Now we can use *args or **kwargs to
# pass arguments to this function :
args = ("Geeks", "for", "Geeks")
myFun(*args)

kwargs = {"arg1": "Geeks", "arg2": "for", "arg3": "Geeks"}
myFun(**kwargs)

Output:

arg1: Geeks
arg2: for
arg3: Geeks
arg1: Geeks
arg2: for
arg3: Geeks

Python BuildIn Function

There are numerous built-in methods in Python that make creating code easier. Learn about the built-in functions of Python in this post as we examine their numerous uses and highlight a few of the most popular ones.

Python Map Function

The map() function returns a map object(which is an iterator) of the results after applying the given function to each item of a given iterable.

Python3
# Return double of n
def addition(n):
    return n + n

# We double all numbers using map()
numbers = (1, 2, 3, 4)
result = map(addition, numbers)
print(list(result))

Output:

[2, 4, 6, 8]

Python Filter Function

The filter() method filters the given sequence using a function that examines each element in the sequence to see if it is true or false.

Python3
# function that filters vowels
def fun(variable):
    letters = ['a', 'e', 'i', 'o', 'u']
    if (variable in letters):
        return True
    else:
        return False


# sequence
sequence = ['g', 'e', 'e', 'j', 'k', 's', 'p', 'r']

# using filter function
filtered = filter(fun, sequence)

print('The filtered letters are:')
for s in filtered:
    print(s)

Output:

The filtered letters are:
e
e

Python Reduce Function

The reduce function is used to apply a certain function to all of the list components indicated in the sequence sent along.

Python3
from functools import reduce 

nums = [1, 2, 3, 4]
ans = reduce(lambda x, y: x + y, nums)
print(ans) 

Output:

10

Python Lambda 

Python Lambda Functions are anonymous, which means they have no name. As we already know, the def keyword is used to define a normal function in Python. The lambda keyword in Python is used to declare an anonymous function.

Python3
calc = lambda num: "Even number" if num % 2 == 0 else "Odd number"

print(calc(20))

Output:

Even number

For More Read, refer Python Built in Functions

Python RegEx

We define a pattern using a regular expression to match email addresses. The pattern r”\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b” is a common pattern for matching email addresses. Using the re.search() function, the pattern is then found in the given text. If a match is found, we use the match object’s group() method to extract and print the matched email. Otherwise, a message indicating that no email was found is displayed.

Python3
import re

# Text to search
text = "Hello, my email is example@example.com"

# Define a pattern to match email addresses
pattern = r"\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b"

# Search for the pattern in the text
match = re.search(pattern, text)

# Check if a match is found
if match:
    email = match.group()
    print("Found email:", email)
else:
    print("No email found.")

Output:

Found email: example@example.com

MetaCharacters are helpful, significant, and will be used in module re functions, which helps us comprehend the analogy with RE. The list of metacharacters is shown below.

  • \ sed to drop the special meaning of character following it.
  • [] Represent a character class.
  • ^ Matches the beginning.
  • $ Matches the end.
  • . Matches any character except newline.
  • | Means OR (Matches with any of the characters separated by it.
  • ? Matches zero or one occurrence.
  • * Any number of occurrences (including 0 occurrences).
  • + One or more occurrences.
  • {} Indicate the number of occurrences of a preceding RegEx to match.
  • () Enclose a group of RegEx.

For More RegEx example, refer to Python RegEx.

File Handling in Python

Python too supports file handling and allows users to handle files i.e., to read and write files, along with many other file handling options, to operate on files.

Python3
import os

def create_file(filename):
    try:
        with open(filename, 'w') as f:
            f.write('Hello, world!\n')
        print("File " + filename + " created successfully.")
    except IOError:
        print("Error: could not create file " + filename)

def read_file(filename):
    try:
        with open(filename, 'r') as f:
            contents = f.read()
            print(contents)
    except IOError:
        print("Error: could not read file " + filename)

def append_file(filename, text):
    try:
        with open(filename, 'a') as f:
            f.write(text)
        print("Text appended to file " + filename + " successfully.")
    except IOError:
        print("Error: could not append to file " + filename)

def rename_file(filename, new_filename):
    try:
        os.rename(filename, new_filename)
        print("File " + filename + " renamed to " + 
                  new_filename + " successfully.")
    except IOError:
        print("Error: could not rename file " + filename)

def delete_file(filename):
    try:
        os.remove(filename)
        print("File " + filename + " deleted successfully.")
    except IOError:
        print("Error: could not delete file " + filename)


if __name__ == '__main__':
    filename = "example.txt"
    new_filename = "new_example.txt"

    create_file(filename)
    read_file(filename)
    append_file(filename, "This is some additional text.\n")
    read_file(filename)
    rename_file(filename, new_filename)
    read_file(new_filename)
    delete_file(new_filename)

Output:

File example.txt created successfully.
Hello, world!

Text appended to file example.txt successfully.
Hello, world!
This is some additional text.

File example.txt renamed to new_example.txt successfu...

Try and Except Statement

In Python, Try and except statements are used to catch and manage exceptions. Statements that can raise exceptions are kept inside the try clause and the statements that handle the exception are written inside except clause.

Python3
a = [1, 2, 3]
try:
    print ("Second element = %d" %(a[1]))

    # Throws error since there are only 3 elements in array
    print ("Fourth element = %d" %(a[3]))

except:
    print ("An error occurred")

Output:

Second element = 2
An error occurred

Python OOPs Concepts

Object-oriented Programming (OOPs) is a programming paradigm in Python that employs objects and classes. It seeks to include real-world entities such as inheritance, polymorphisms, encapsulation, and so on into programming. The primary idea behind OOPs is to join the data and the functions that act on it as a single unit so that no other portion of the code can access it.

In this example, we have a Car class with characteristics that represent the car’s make, model, and year. The _make attribute is protected with a single underscore _. The __model attribute is marked as private with two underscores __. The year attribute is open to the public.

We can use the getter function get_make() to retrieve the protected attribute _make. We can use the setter method set_model() to edit the private attribute __model. Using the getter method get_model(), we may retrieve the changed private attribute __model. There are no restrictions on accessing the public attribute year. We manage the visibility and accessibility of class members by using encapsulation with private and protected properties, offering a level of data hiding and abstraction.

Python3
class Car:
    def __init__(self, make, model, year):
        self._make = make  # protected attribute
        self.__model = model  # private attribute
        self.year = year  # public attribute

    def get_make(self):
        return self._make

    def set_model(self, model):
        self.__model = model

    def get_model(self):
        return self.__model


my_car = Car("Toyota", "Corolla", 2022)

print(my_car.get_make())  # Accessing protected attribute
my_car.set_model("Camry")  # Modifying private attribute
print(my_car.get_model())  # Accessing modified private attribute
print(my_car.year)  # Accessing public attribute

Output:

Toyota
Camry
2022

Python Modules

A library is a group of modules that collectively address a certain set of requirements or applications. A module is a file (.py file) that includes functions, class defining statements, and variables linked to a certain activity. The term “standard library modules” refers to the pre-installed Python modules.

Python Interview Questions Answers

Python Cheat Sheet – FAQs

Q. What are the key features of Python?

Features of Python includes readability, simplicity, extensive library support, cross-platform compatibility, dynamic typing, a strong community, and object-oriented programming (OOP).

Q. What type of language is Python? Programming or scripting?

Python is capable of scripting, but in a general sense, it is considered a general-purpose programming language.

Q. What is PEP 8?

PEP stands for Python Enhancement Proposal. It is a set of rules that specify how to format Python code for maximum readability.

Q. What is the difference between .py and .pyc files?

The .py files are the python source code files and the .pyc files contain the bytecode of the python files. .pyc files are generated when the code is imported from some other source. The interpreter converts the source .py files to .pyc files which helps by saving time. 

Q. What are the main data structures in Python?

Python supports lists, tuples, sets, and dictionaries as its primary data structures, each serving different purposes.



Previous Article
Next Article

Similar Reads

Docker Cheat Sheet : Complete Guide (2024)
Docker is a very popular tool introduced to make it easier for developers to create, deploy, and run applications using containers. A container is a utility provided by Docker to package and run an application in a loosely isolated environment. Containers are lightweight and contain everything needed to run an application, such as libraries and oth
11 min read
Complexity Cheat Sheet for Python Operations
Python built-in data structures like list, sets, dictionaries provide a large number of operations making it easier to write concise code but not being aware of their complexity can result in unexpected slow behavior of your python code. Prerequisite: List, Dictionaries, Sets For example: A simple dictionary lookup Operation can be done by either :
2 min read
Python OpenCV Cheat Sheet
The Python OpenCV Cheat Sheet is your complete guide to mastering computer vision and image processing using Python. It's designed to be your trusty companion, helping you quickly understand the important ideas, functions, and techniques in the OpenCV library. Whether you're an experienced developer needing a quick reminder or a newcomer excited to
15+ min read
Regex Cheat Sheet - Python
Regex or Regular Expressions are an important part of Python Programming or any other Programming Language. It is used for searching and even replacing the specified text pattern. In the regular expression, a set of characters together form the search pattern. It is also known as the reg-ex pattern. The tough thing about Regex is not learning or un
9 min read
jQuery Cheat Sheet – A Basic Guide to jQuery
What is jQuery?jQuery is an open-source, feature-rich JavaScript library, designed to simplify the HTML document traversal and manipulation, event handling, animation, and Ajax with an easy-to-use API that supports the multiple browsers. It makes the easy interaction between the HTML & CSS document, Document Object Model (DOM), and JavaScript.
15+ min read
Tkinter Cheat Sheet
Tkinter, the standard GUI library for Python, empowers developers to effortlessly create visually appealing and interactive desktop applications. This cheat sheet offers a quick reference for the most common Tkinter widgets and commands, along with valuable tips and tricks for crafting well-designed UIs. In this Cheat Sheet, whether you're a beginn
8 min read
CSS Cheat Sheet - A Basic Guide to CSS
What is CSS? CSS i.e. Cascading Style Sheets is a stylesheet language used to describe the presentation of a document written in a markup language such as HTML, XML, etc. CSS enhances the look and feel of the webpage by describing how elements should be rendered on screen or in other media. What is a CSS Cheat Sheet? CSS Cheat Sheet provides you wi
13 min read
ggplot2 Cheat Sheet
Welcome to the ultimate ggplot2 cheat sheet! This is your go-to resource for mastering R's powerful visualization package. With ggplot2, you can create engaging and informative plots effortlessly. Whether you're a beginner or an experienced programmer, ggplot2's popularity and versatility make it an essential skill to have in your R toolkit. If you
13 min read
C Cheat Sheet
This C Cheat Sheet provides an overview of both basic and advanced concepts of the C language. Whether you're a beginner or an experienced programmer, this cheat sheet will help you revise and quickly go through the core principles of the C language. In this Cheat Sheet, we will delve into the basics of the C language, exploring its fundamental con
15+ min read
React Cheat Sheet
React is an open-source JavaScript library used to create user interfaces in a declarative and efficient way. It is a component-based front-end library responsible only for the view layer of a Model View Controller (MVC) architecture. React is used to create modular user interfaces and promotes the development of reusable UI components that display
9 min read
NumPy Cheat Sheet: Beginner to Advanced (PDF)
NumPy stands for Numerical Python. It is one of the most important foundational packages for numerical computing & data analysis in Python. Most computational packages providing scientific functionality use NumPy’s array objects as the lingua franca for data exchange. In this Numpy Cheat sheet for Data Analysis, we've covered the basics to adva
15+ min read
Angular Cheat Sheet - A Basic Guide to Angular
Angular is a client-side TypeScript-based, front-end web framework developed by the Angular Team at Google, that is mainly used to develop scalable single-page web applications(SPAs) for mobile & desktop. Angular is a great, reusable UI (User Interface) library for developers that helps in building attractive, steady, and utilitarian web pages
15+ min read
Bootstrap Cheat Sheet - A Basic Guide to Bootstrap
Bootstrap is a free, open-source, potent CSS framework and toolkit used to create modern and responsive websites and web applications. It is the most popular HTML, CSS, and JavaScript framework for developing responsive, mobile-first websites. Nowadays, websites are perfect for all browsers and all sizes of screens. What is Bootstrap Cheat Sheet?A
15+ min read
GeeksforGeeks Master Sheet - List of all Cheat Sheets
In this Master Sheet, we’ll cover all the important cheat sheets like SDE Sheets, DSA Topics Sheets, HTML, CSS, JavaScript, React, Angular, Bootstrap, jQuery, Python, Data Science, C, C++, Java, Computer Networks, Company Wise SDE sheets, etc. What is a Master Sheet ? A selection of comprehensive reference aids in the form of cheat sheets are provi
10 min read
Git Cheat Sheet
Git Cheat Sheet is a comprehensive quick guide for learning Git concepts, from very basic to advanced levels. By this Git Cheat Sheet, our aim is to provide a handy reference tool for both beginners and experienced developers/DevOps engineers. This Git Cheat Sheet not only makes it easier for newcomers to get started but also serves as a refresher
10 min read
C++ STL Cheat Sheet
The C++ STL Cheat Sheet provides short and concise notes on Standard Template Library (STL) in C++. Designed for programmers that want to quickly go through key STL concepts, the STL cheatsheet covers the concepts such as vectors and other containers, iterators, functors, etc., with their syntax and example. What is Standard Template Library(STL)?T
15+ min read
HTML Cheat Sheet
HTML (HyperText Markup Language) serves as the foundational framework for web pages, structuring content like text, images, and videos. HTML forms the backbone of every web page, defining its structure, content, and interactions. Its enduring relevance lies in its universal adoption across web development, ensuring that regardless of the framework
15 min read
JavaScript Cheat Sheet - A Basic Guide to JavaScript
JavaScript is a lightweight, open, and cross-platform programming language. It is omnipresent in modern development and is used by programmers across the world to create dynamic and interactive web content like applications and browsers. It is one of the core technologies of the World Wide Web, alongside HTML and CSS, and the powerhouse behind the
15+ min read
Linux Commands Cheat Sheet
Linux, often associated with being a complex operating system primarily used by developers, may not necessarily fit that description entirely. While it can initially appear challenging for beginners, once you immerse yourself in the Linux world, you may find it difficult to return to your previous Windows systems. The power of Linux commands in con
13 min read
Subnet Mask Cheat Sheet
A Subnet Mask is a numerical value that describes a computer or device's how to divide an IP address into two parts: the network portion and the host portion. The network element identifies the network to which the computer belongs and the host part identifies the unique computer on that network. An IP address is made up of four digits separated by
9 min read
Java Cheat Sheet
Java is a programming language and platform that has been widely used since its development by James Gosling in 1991. It follows the Object-oriented Programming concept and can run programs written on any OS platform. Java is a high-level, object-oriented, secure, robust, platform-independent, multithreaded, and portable programming language all th
15+ min read
Writing to an excel sheet using Python
Using xlwt module, one can perform multiple operations on spreadsheet. For example, writing or modifying the data can be done in Python. Also, the user might have to go through various sheets and retrieve data based on some criteria or modify some rows and columns and do a lot of work. Let's see how to create and write to an excel-sheet using Pytho
2 min read
Python | Plotting charts in excel sheet using openpyxl module | Set - 1
Prerequisite: Reading & Writing to excel sheet using openpyxl Openpyxl is a Python library using which one can perform multiple operations on excel files like reading, writing, arithmetic operations and plotting graphs. Let's see how to plot different charts using realtime data. Charts are composed of at least one series of one or more data poi
6 min read
Python | Plotting charts in excel sheet using openpyxl module | Set – 2
Prerequisite: Python | Plotting charts in excel sheet using openpyxl module | Set – 1 Openpyxl is a Python library using which one can perform multiple operations on excel files like reading, writing, arithmetic operations and plotting graphs. Charts are composed of at least one series of one or more data points. Series themselves are comprised of
6 min read
Python | Plotting charts in excel sheet using openpyxl module | Set 3
Prerequisite : Plotting charts in excel sheet using openpyxl module Set - 1 | Set – 2Openpyxl is a Python library using which one can perform multiple operations on excel files like reading, writing, arithmetic operations and plotting graphs. Charts are composed of at least one series of one or more data points. Series themselves are comprised of r
7 min read
Python | Plotting Area charts in excel sheet using XlsxWriter module
Prerequisite: Create and write on an excel file XlsxWriter is a Python library using which one can perform multiple operations on excel files like creating, writing, arithmetic operations and plotting graphs. Let’s see how to plot different charts using realtime data. Charts are composed of at least one series of one or more data points. Series the
6 min read
Python | Plotting bar charts in excel sheet using XlsxWriter module
Prerequisite: Create and Write on an excel file.XlsxWriter is a Python library using which one can perform multiple operations on excel files like creating, writing, arithmetic operations and plotting graphs. Let’s see how to plot different type of Bar charts using realtime data. Charts are composed of at least one series of one or more data points
6 min read
Python | Plotting Radar charts in excel sheet using XlsxWriter module
Prerequisite:Create and Write on excel file XlsxWriter is a Python library using which one can perform multiple operations on excel files like creating, writing, arithmetic operations and plotting graphs. Let’s see how to plot different type of Radar charts using realtime data. Charts are composed of at least one series of one or more data points.
6 min read
Python | Plotting scatter charts in excel sheet using XlsxWriter module
Prerequisite: Create and Write on an excel file. XlsxWriter is a Python library using which one can perform multiple operations on excel files like creating, writing, arithmetic operations and plotting graphs. Let’s see how to plot different type of Scatter charts using realtime data. Charts are composed of at least one series of one or more data p
10 min read
Python | Plotting column charts in excel sheet using XlsxWriter module
Prerequisite: Create and Write on an excel file.XlsxWriter is a Python library using which one can perform multiple operations on excel files like creating, writing, arithmetic operations and plotting graphs. Let’s see how to plot different type of Column charts using realtime data. Charts are composed of at least one series of one or more data poi
7 min read
Practice Tags :