Underscore | What is the Meaning of Single and Double Underscore Before an Object Name?

In this post, we will learn more about What is the meaning of single and double underscores before an object name. where each single and double have different use in python which we will discuss below with example to explain all these and get a clear idea of both.  Single Underscore As we know a … Read more

Meaning of @Classmethod And @Staticmethod For Beginners

In this post, we will get to know the Meaning of classmethod and @staticmethod for beginner where they both are decorators which we can use for defining the method with the class we are working on, Moreover, these are the methods created for calling of the class without creating an instance of the class. Which … Read more

Newline | How Can I Remove A Trailing Newline In Python?

In this post, we will learn How can I remove a trailing newline which we can perform using an in built function rstrip() which is used for removing all the white spaces and characters which could be there in the output which is nothing but the trailing empty lines at the end of any string, … Read more

How To Check If the String Is Empty?

In this post, we will discuss How to check if the string is empty which we can do using the len() built in function to get the length of the string and then compare it with zero is one of the ways to get it done another way it checking if it is non zero … Read more

Why is Reading lines From Stdin Much Slower in C++ Than Python?

In this post, we will learn Why is reading lines from stdin is much slower in C++ than in Python which might be because of a number of reasons like because of complexity, because of an interpreter, and might not optimization which we will discuss in this post here one by one. Reading Lines In … Read more

How To Limit Float To Two Decimal Points?

In this post, we will learn How to Limit float to two decimal points where we can use the round () function and where we can provide the variable and the number of decimal points we want as the argument of the function. Limit the Decimal points In Float Values Using Round Method As we … Read more

Does Python Have a Ternary Conditional Operator?

In this post, we will try to find out Does Python have a Ternary conditional operator as we know that ternary operators are another way to write the if else condition in a single line And yes, Python too supports it for the execution of the program. And here we have given an example to … Read more

What Does The “yield” Keyword Do in Python?

In this post, we will learn What the “yield” keyword does in Python where it is used for creating a generator function. Where after this statement is executed it suspends the execution of the function and sends the value back to the function caller, Although it has the authority and functionality to resume the function … Read more

%d bloggers like this: