Skip to content
Python Helper
Get Started
Menu Toggle
What is Python Programming?
Install Python On Centos 7 & 8
Install Python On Mac OS
Install Python On Ubuntu
Install Python On Windows
Python Basics
Menu Toggle
Python Syntax
Python Variables
Python Constants
Python Data Types
Python Numbers
Python Strings
Python Boolean
Control Flows
Menu Toggle
Python Ifâ¦Elifâ¦Else Statements
Python For Loop
Python While Loop
Non-Pri DataTypes
Menu Toggle
Python List
Python List Iteration
Python List Methods
Menu Toggle
Python List append()
Python List Extend()
Python List insert()
Python List remove()
Python List pop()
Python List index()
Python List count()
Python List Sort()
Python List reverse()
Python List copy()
Python List clear()
Python Tuples
Python Sets
Python Set Methods
Menu Toggle
Python set add()
Python Set update()
Python set copy()
Python set clear()
Python set difference()
Python Set difference_update()
Python set discard()
Python Set Intersection()
Python set intersection_update()
Python Set isdisjoint()
Python Set issubset()
Python Set issuperset()
Python Set pop()
Python Set remove()
Python Set symmetric_difference()
Python Set symmetric_difference_update()
Python Set union()
Python Dictionary
Python Dictionary Methods
Menu Toggle
Python Dict Get()
Python Dict update()
Python Dict clear()
Python Dict copy()
Python Dict items()
Python Dict keys()
Python Dict values()
Python Dict fromkeys()
Python Dict pop()
Python Dict popitem()
Python Dict setdefault()
Python Functions
Menu Toggle
What is a Function?
Function Arguments
Menu Toggle
Positional Arguments
Default Arguments
Keyword Arguments
Python Built-in Functions
Recursive Function
Lambda Functions
File Handling
Menu Toggle
What is File Handling?
Read Files
Write Files
Delete Files
OOPs
Menu Toggle
Python OOP Concepts
Classes and Objects
Polymorphism
Inheritance
Encapsulation
Constructors
Destructors
Python Helper
Main Menu
Python Helper
Search for:
Search Button
Python Syntax
What is the Syntax for Python?
Is Python Syntax Easy?
Understanding Python Identifiers
Naming Rules
Best Practices for Choosing Identifiers
Reusing and Modifying Identifiers
Why Whitespace and Indentation Matter
Understanding String Literals
I. Greeting a Celebrity
II. Formatting a Location
Python Variables
How to Declare variable in Python?
Why Does Python Use Variables?
Variable Naming in Python
Camel Case or Underscores
What Are Python Variable Types?
Numeric Variables
String Variables
Boolean Variables
List Variables
Dictionary Variables
Python Data Types
What are data types in Python?
What are Numeric Data Types?
I. Integers (int)
II. Floating-Point Numbers (float)
What is a String Data Type?
What is a Boolean Data Type?
Sequence Data Types
I. Lists
II. Tuples
III. Range
Python Strings
How to Create a Python String?
Understanding String Immutability
Python Strings Indexing
Negative Indices
Understanding String Length
Python String Slicing to Extract Substrings
Understanding String Concatenation
Exploring String Repetition
Mixing Concatenation and Repetition
Python Boolean
What is a Boolean in Python?
How do you create a Boolean in Python?
Performing Boolean Operations
Logical AND (
and
)
Logical OR (
or
)
Logical NOT (
not
)
Making Decisions with Conditional Statements
Comparing Values with Comparison Operators
Equal to
==
Python For Loop
Python For Loop Syntax and Structure
Python For loop (Iterating Over a Sequence)
Accessing Elements in a List or Tuple
Iterating Over a String
Iterating Over a Range of Numbers
Using 'in' Keyword for Iteration
Looping Through a Dictionary
Enumerating Items in a Sequence
Skipping Iteration with Continue Statement
Breaking out For Loop with Break Statement
Python set add() Method
What is the Purpose of Python set add()?
Python set add() Syntax and Parameters
How does set add work in Python?
I. Adding a Single Element to a Set
II. Adding Numbers to a Set
III. Adding Strings to a Set
IV. Adding Mixed Data Types to a Set
V. Adding Variables to a Set
VI. Adding Constants to a Set
VII. Adding Elements in a Loop
Python Dictionary
What are the keys and values of a dictionary?
Python Dictionary Syntax and Parameters
I. Creating a Dictionary and Setting Initial Values
II. Accessing Dictionary Elements
III. Adding Elements in Dictionary
IV. Modifying Dictionary Elements
V. Copying Dictionary Elements
VI. Removing Dictionary Elements
VII. Merging Multiple Dictionaries
VIII. Nested Dictionaries: Creating Complex Data Structures
Python abs() Function | Absolute
Python abs() Syntax and Parameters
What does abs() do in Python?
I. Absolute Value of Integers
II. Absolute Value of Floating-Point Numbers
III Handling Complex Numbers with the abs() Function
IV. Using abs() Function with Variables and Expressions
V. Python abs() in Comparison and Conditional Statements
VI. Python abs() with Custom Classes
VII. Python abs() for Iterable Objects
VIII. Python abs() with NumPy Arrays
Python all() Function
Compatibility and Version Requirements
Python all() Syntax and Parameters
What does all() do in Python?
I. Checking if All Elements are True
II. Evaluating Truthiness of Strings and Numbers
III. Combining all() with List Comprehension
IV. Checking if All Elements in a Tuple are True
V. Evaluating Truthiness of Elements in a Set
VI. Evaluating Truthiness of Values in a Dictionary
VII. Dealing with Empty Iterables
Python any() Function
Python any Syntax and Parameters
Compatibility and Version Requirements
Evaluating Truthiness with any()
Working with Iterables in any()
I. Checking if Any Element is True
II. Evaluating Truthiness of Strings and Numbers
III. Combining any() with List Comprehension
IV. Working with Tuples
V. Working with Sets
VI. Working with Dictionaries
Python ascii() Function
Python ascii() Syntax and Parameter
How does Python ascii() function works?
I. Converting Python String to ASCII
II. Converting a Non-ASCII String to its ASCII Representation
III. Converting Integers to their ASCII Representation
IV. Converting Characters in a Tuple to ASCII
V. Converting Characters in a List to ASCII
VI. Converting Characters in a Set to ASCII
VII. Converting Characters in a Dictionary to ASCII
The Return Value of ascii() Function in Python
Python bytearray() Function
Python bytearray() Syntax and Parameters
I. Iterable
II. Encoding
III. Errors
Python bytearray() return value
How to Create a Python bytearray() Object?
I. Python bytearray() with no Parameters
II. Size of Python bytearray()
III. Combining bytearrays()
IV. Modifying a bytearray in-place
Python bytes() Function
Python bytes() Syntax and Parameters
I. Source
II. Encoding
III. Errors
Python bytes() return value
What does bytes() do in python?
I. Creating Object with bytes()
II. Python bytes() Indexing
III. Python bytes() Slicing
IV. Python bytes() Concatenation
Python callable() Function
Python callable() Syntax and Parameter
Python callable() return value
What does callable() do?
I. Creating a Callable Function
II. Working with Callable() Objects
III. Function Callability with callable()
Checking Callability of Various Object Types
I. Python callable() with Functions
II. Python callable() with Methods
III. Python callable() with Classes
Python chr() Function
Python chr() Syntax and Parameter
Python chr() return value
What Does Python chr() do?
I. Creating Object with chr()
II. Python chr() Character Range
III. Python chr() Character Out of Range
Converting Different data types to chr()
I. Integer to chr()
II. Python chr() to Integer
III. Float to chr()
Python complex() Function
Python complex() Syntax and Parameters
I. Real
II. Imag
Python complex() Return Value
What does complex() do in Python?
I. Python complex() Object Creation
II. Creating complex numbers with complex()
III. Creating Complex Number without complex()
Converting Other Data Types Using complex()
I. Converting Integers to Complex Number
Python delattr() Function
Python delattr() Syntax and Parameters
I. Object
II. Attribute
Python delattr() Return Value
What Does delattr() Function Do?
I. Python delattr() Object Creation
II.
How to Delete an Attribute from an Object?
III. Python delattr() Attribute Error
IV. How to Delete an Attribute of Class Instances?
Python delattr() Advanced Examples
Python dict() Function
Python dict() Syntax and Parameters
I. Keyword Arguments (kwargs)
II. Mapping Object
III. Iterable
Python dict() Return Value
What Does dict() Function Do?
I. Creation of dict() Object
II. Deep-Copying Dictionaries with dict()
III. Using zip() with dict()
Handling Different Data Types with dict()
Python dir() Function
Python dir() Syntax and Parameter
Python dir() Return Value
What Does dir() Function Do?
I. Python dir() with Arguments
II. Python dir() without Arguments
III. Python dir() with Modules
IV. Python dir() with Function Attributes
Python dir() and Non-Primitive Datatype
I. Python dir() with List
II. Python dir() with Tuple
Python enumerate() Function
What is a the Purpose of enumerate() ?
Python enumerate() Syntax and Parameters
I. Iterable
II. Start (optional)
Python enumerate() Return Value
What Does enumerate() do in Python?
I. Creating a enumerate() Object
II. Enumerate() Start Position: 0 or 1
III. Adding Counter to Iterable with enumerate()
Python enumerate() with Non-Primitive Datatype
Python eval() Function
Python eval() Syntax and Parameters
I. Expression
II. Globals (optional)
III. Locals (optional)
Python eval() Return Value
What Does eval() Function Do?
I. Creating an eval() Object
II. Evaluating Expressions using eval()
III. Boolean Expressions using eval()
IV. Checking Conditions using eval()
Python exec() Function
What is the Purpose of exec() ?
Python exec() Syntax and Parameters
I. Object
II. Globals (Optional)
III. Locals (Optional)
Python exec() Return Value
What Does exec() Function Do?
I. Creating an exec() Object
II. Utilizing exec() for Statements and Expressions
III. Exec() with Single Statement
Python filter() Function
What is the Purpose of filter() ?
Python filter() Syntax and Parameters
I. Function
II. Iterable
Python filter() Return Value
What Does filter() Function Do?
I. Creation of filter() Object
II. Using None as a Function Inside filter()
III. Python filter() with Lambda Function
IV. Python filter() with While Loop
Python float() Function
Python float() Syntax and Parameter
Python float() Return Value
What does float() do in Python?
I. Creating float() Object
II. Converting Integer into Float
II. Converting String into Float
III. Python float() with Invalid Input
IV. Python float() with Infinity and NaN
V. Python float() with Precision and Rounding
Python float() Advanced Examples
Python format() Function
Python format() Syntax and Parameters
Python format() Return Value
What Does format() Function Do?
I. Creating an Object through format() function
II. Python String format() and Value Formatting
III. Python Single String format()
IV. Python format() - Index-Based Replacement
V. Python String format() IndexError
VI. Python format() and Escape Sequences
VII. Python format() with Positional and Keyword Arguments
Python id() Function
Python id() Syntax and Parameter
Python id() Return Value
I. Creation of id() Object
II. Python id() for Object Identification
Using id() with Different Object Types
I. Python id() with Strings
II. Python id() with Float
Python id() Advanced Examples
I. Python id() with Set
II. Python id() with Tuple
Python input() Function
What is a Purpose of input() Function?
Python input() Syntax and Parameter
Python input() Return Value
I. Creation of input() Object
II. Python input() with Integers
III. Python input() with Float
IV. Python input() with Conditional Statements
Python input() Advanced Examples
I. Python input() with Lists
II. Python input() with Dictionaries
Python int() Function
Python int() Syntax and Parameter
Python int() Return Value
I. Creation of int() Object
II. Python int() Size
III. Python int() with Two Arguments
IV. Python int() with Float
V. Handling Invalid Input for int()
Python int() Advanced Examples
I. Invalid Literal for int() with Base 10
II. Arithmetic and Mathematical Calculations with int()
Python isinstance() Function
Python isinstance() Syntax and Parameters
I. Object
II. Type
Python isinstance() Return Value
I. Creation of isinstance() Object
II. Python isinstance() with Float
III. Using isinstance() for Type Checking and Validation
IV. Python isinstance() with User-Defined Classes
V. Python isinstance() Time Complexity
Python isinstance() Advanced Examples
Python iter() Function
Python iter() Syntax and Parameter
Python iter() Return Value
I. Creation of iter() Object
II. Python iter() with Strings
III. Python iter() with Sentinel Parameter
IV. Python iter() with Range
Python iter() Advanced Examples
I. Python iter() with Tuple
II. Python iter() with Set
III. Custom Iteration with the iter()
Python len() Function
What is a Purpose of len() Function?
Python len() Syntax and Parameter
Python len() Return Value
I. Creation of the len() Object
II. Python len() with Float
III. Python len() with Complex Number
IV. Python len() with Bytes
V. Python len() with Range
Python len() Advanced Examples
I. Python len() with Tuple
Python List Function
Python List Function Syntax and Parameter
Python list() Return Value
I. Creation of list() Object
II. Python list() with Integer
III. Python list() with Float
IV. Python list() with User Input
V. Python list() with Conditional Statement
Python list() Advanced Examples
I. Modifying and Manipulating list()
II. Crafting a List from a Tuple
Python map() Function
Python map() Syntax and Parameters
I. Function
II. Iterable
Python map() Return Value
I. Creation of map() Object
II. Python map() with Lambda
III. Handling Uneven Lengths in map() Input
IV. Python map() with Conditional Statement
Python map() Advanced Examples
I. Python map() with Dictionary
Python max() Function
Python max() Syntax and Parameters
I. Iterable
II. Key (Optional)
III. Default (Optional)
Python max() Return Value
I. Creation of max() Object
II. Python max() with Floats
III. Python max() Index
IV. Handling Empty Iterables with max()
V. Python max() with Conditional Statement
Python min() Function
Python min() Syntax and Parameter
Python min() Return Value
I. Creation of min() Object
II. Python min() with Complex Numbers
III. Value Error in min()
IV. Using min() for Multi-Criteria Minimum Values
Python min() Advanced Examples
I. Python min() with Conditional Statement
II. Python min() with Dictionary
III. Python min() Function with Objects
Python memoryview() Function
Python memoryview() Syntax and Parameter
Python memoryview() Return Value
I. Creating a memoryview() Object
II. Python memoryview() with Large Data
III. Memoryview() with Data Type and Object Compatibility
IV. Data Manipulation with memoryview()
Python memoryview() Advanced Examples
I. Memoryview() Connection to Slices and Subarrays
II. Python memoryview() to Bytes
III. Python memoryview() with While Loop
Python next() Function
Python next() Syntax and Parameters
I. Iterator
II. Default (optional)
Python next() Return Value
I. Creation of next() Object
II. Python next() with String
III. Passing Default Value to next()
IV. Next() Performance with Large Data Sets
V. Python next() StopIteration
Python next() Advanced Examples
Python oct() Function
Python oct() Syntax and Parameter
Python oct() Return Value
I. Creation of oct() Object
II. Handling Negative Integers with oct()
III. Converting Binary to Octal using oct()
IV. Converting Hexadecimal to Octal using oct()
V. Python oct() with Conditional Statement
Python oct() Advanced Examples
I. Python oct() with List
II. Utilizing oct() for Bit Manipulation
Python ord() Function
Python ord() Syntax and Parameter
Python ord() Return Value
I. Creation of ord() Object
II. Ord() for Unicode Character Code Retrieval
III. Handling Non-ASCII and Special Characters with ord()
IV. Error Condition while Using ord()
Python ord() Advanced Examples
I. Character Manipulation using ord()
II. Python ord() with Tuple
III. Handling Complex Characters with ord()
Scroll to Top