Joseph

How to print integer values in Python

How to Print Integer Values in Python?

To print integer values, the “print()” function, “f-string” method, and “sys.stdout.write()” function of the “sys” module are used in Python.

Check if a variable is Null in Python

Check if a Variable is Null in Python

The “is” and “is not” operators, “==” and “!=” operators, and “if-else” Statements are used to check the “Null/None” variable in Python.

Python return Statement | Explained

Python return Statement | Explained

Python’s “return” function has a “return” statement inside the function, and when executed, it sends back the value to the main program.

Python math.pow() | Power of a Number

Python math.pow() | Power of a Number

To calculate the power of a number “math.pow()” function is utilized in the Python program. It returns a value of base raised to a power of exponent

Python map() Function | Explained

Python map() Function | Explained

To execute a specified function on each of the elements of an iterable such as a tuple, list, etc., the “map()” function is used in Python.

__init()__ function in Python

Python __init__() function | Explained

In Python, the “__init__()” function is used to initialize the value of the object attribute of the class. It calls automatically when the object is created

How to Reverse a String in Python

How to Reverse a String in Python?

To reverse a string in Python, the “string slicing”, “for” loop, “while” loop, “recursion” function, and “reversed()” function are used.

KeyError 0 exception in Python

KeyError: 0 exception in Python

The “KeyError: 0 exception” occurs in Python when we try to access a “0” key in the given dictionary where the key value is not present.

How to Comment in Python

How to Comment in Python?

To comment in Python, a hash symbol “#” is used at the start of any code line. String literals are also utilized to make comments in Python script.

Python range() Function _ Explained

Python Range With Steps

In Python, the “range()” function creates the sequence of numbers by specifying the upper and lower limit with the addition of step size value.

Convert List Into Tuple

Python | Convert List Into Tuple

To convert the list into a tuple, the “tuple()” function, “for loop”, and “unpacking list operator (*List, ) ” with a single comma are used.

Python Empty Tuple

Python Empty Tuple | Explained

To create an empty tuple, the “tuple()” function and empty parentheses are used in Python. For instance, “()” represents an empty tuple.

Python List Reverse() Function _ Explained

Python List reverse() Method | Explained

To reverse the list element, the “reverse()” method is used in Python. The “reversed()” function also accepts the list and returns the reversed iterable object.

Python while Loop _ Explained

Python While Loop | Explained

“while” loop executes the block of code until the condition remains “True”. It iterates infinite times if the increment/decrement value is not defined.

Python | Convert Hex to Decimal

Python | Convert Hex to Decimal

In Python, the hexadecimal to decimal conversion is carried out using the inbuilt “int()” function, “literal_eval()”, “while” loop, and “dictionary”.