Posts

Python Tutorial | Learn Python Programming Language

Image
Python Basics   1.  Python - Introduction  2.  Python - Local Environment Setup  3.  Python - Writing Programs  4.  Python - Variables  5.  Python - Data Types  6.  Python - Type Conversion and Casting  7.  Python - Operators  8.  Python - Conditional if  9.  Python - Cycles 10.  Python - Functions and Function parameters 11.  Python - Lambda 12.  Python - Console Input and Output 13.  Python - Literals 14.  Python - Return Statement 15.  Python - Function as Type, Parameter and Result of Another Function Python Object-oriented programming   1.  Python - Classes and Objects  2.  Python - Encapsulation  3.  Python - Inheritance  4.  Python - Polymorphism  5.  Python - Abstract Classes Python Handling Errors and Exceptions 1.  Python - Try, Except, and Finally 2.  Python - Except and Handling Different Types of Exceptions 3.  Python - Throwing and Creating Custom exceptions Python  - Lists, Tuples, Dictionaries, and Sets 1.  Python - Lists 2.  Python - Tuples 3.  Python - Dictionaries 4.

Java this keyword - Example

The ' this ' keyword in Java is a keyword that can be used inside a class method or constructor. The 'this' keyword works as the reference to the current object, whose method or constructor is being invoked. You can use the 'this' keyword to reference any member of the current object inside an instance method or constructor. Following are the ways to use the ' this ' keyword in java: 1. Using ' this ' keyword to refer to current class instance variables 2. Using  this () to invoke the current class constructor 3. Using  ' this '  keyword to return the current class instance 4. Using  ' this '  keyword as a method parameter 5. Using  ' this '  keyword to invoke the current class method 6. Using  ' this '  keyword as an argument in the constructor call Using 'this' keyword to refer to current class instance variables //Java code for using 'this' keyword to //refer current class instance variables publ

Python Built-In Modules - Examples

Image
Built-in modules are part of the Python programming language and comes with the Python distribution. A built-in module can be used directly in a Python program without any installation or setup. These modules simplify the development process by allowing the developers to use the pre-defined functions and classes for routine work, code reuse, and productivity. Some examples of built-ins are math, random, json, os datetime, and sys. Let’s take a look at a Python code example of some of the built-in module and how you can use it in your Python code. random module The random module is responsible for generating random numbers. The main functions of the random module are: random():  generates a random number in the range of 0.0 and 1.0 randint():  returns a random number within a given range randrange(): returns a random number from the given range of numbers shuffle(): shuffles the list choice(): returns a random list element The random floating point number between 0.0 and 1.0 is the resu