Loops in PythonLoops in Python

0 Comments

Range method returns values between start and stop, increasing by the value of step (defaults to 1)…   range(start, stop, step) >>> for i in range (0, 10): … print(i) File “<stdin>”, line 2 print(i) ^ IndentationError: expected an indented block Lets fix this with a comma before print statement for


String in PythonString in Python

0 Comments

Str.capitalize() returns a copy of the string containing first character capitalized and the rest in lowercased x = "hello" x.capitalize()   Output: Hello Str.lower() returns a string in which all characters are in lowercased x = "HELLO" x.lower() Output: hello Str.upper() returns a string in which all characters are in uppercased x=


Python TutorialPython Tutorial

0 Comments

You can download python from https://www.python.org/downloads/ don’t forget to mention python path in environment variables. You can also install Anaconda and work on Ipython or Jypyter https://www.anaconda.com/download So after installation in your terminal, you can simply run the command: python To open the python shell and start running python commands.


InterfaceInterface

0 Comments

Interface in java is a model/prototype of a class. It has static constants and methods (without implementation). There can be only abstract methods in the java interface not method body. It is used to achieve abstraction and multiple inheritance in Java. It cannot be instantiated. Three reasons to use interface. They


AbstractionAbstraction

0 Comments

Abstraction is to hide the unnecessary details from the user and to show only relevant things/data to the user. Abstract class: Abstract class in Java contains the abstract keyword. If a class is declared abstract, it cannot be instantiated, means that you cannot create an object of an abstract class. Also, an


InheritanceInheritance

0 Comments

Inheritance is such a concept in which one object interact with the other object, where the properties of one class can be inherited by another class. It help developer or programmer to reuse code and create a new bond between classes. Two things involved in this process; Parent class (Base


Pyramid NumbersPyramid Numbers

0 Comments

Below programs display the pyramid of numbers based on user input // Library to import import java.util.Scanner; Scanner input = new Scanner (System.in); // for taking input from user System.out.println("Enter the Input Number that how many times do you want to get pyramid of numbers : "); int inputNumber =