Python: Logical Operators

Operator Description and or not Notes “and” and “or” do not always return boolean results. If the operands are boolean then “and“, “or” return a boolean result. These operators return some value otherwise. and Output: Output: Output: or Output: Output: Output: not Output:

Python: Class and Object

An object in Python(and in general OOP) is a collection of data, and the behavior associated with the different aspects of the object. Object-Oriented Programming(OOP) refers to, objects being the primary focus while programming and modeling all real-world entities as objects. So when we analyze a problem, we need to identify 2 things- Class is … Read more

Python: Exception Handling

Case #1 Run the script again and enter some string when it asks for the price- Run the script and enter some decimal value when it asks for the price- Case #2 If we know what type of exception might occur in certain cases, then we can define the except to handle that type of … Read more