Hello, World - shahzade baujiti

Breaking

Wednesday, April 24, 2019

Hello, World

Hello, World

Python is an interpreted programming language, this means that as a developer you write Python files in a text editor and save the file with .py and then put that file into the python interpreter to be executed.

Printing
Programming tutorials since the beginning of time have started with a little program called "Hello, World!

Let's write our first Python file, called helloworld.py, in any text editor.
     
print("Hello world!")
Copy
Note: Copy and Paste Code into Compiler
Open Compiler 

Code Indentation

This is the most important rule of python programming. In programming language like Java, C or C++, generally curly brackets { } are used to define a code block, but python doesn't use brackets, then how does python knows where a particular code block ends.

Well python used indentation for this. It is recommended to use tab for indentation, although you can use four spaces for indentation as well.

For example:
if True:
    # this is inside if block
    print("I Love Python..")
Copy
Note: Copy and Paste Code into Compiler
Open Compiler 

PreviousNext

No comments:

Post a Comment