Loop in PythonLoop 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=


Hello Python! Get Started with PythonHello Python! Get Started with Python

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.


How to print in Pyramid of Numbers in Java?How to print in Pyramid of Numbers in Java?

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 =