Computer Science, asked by pkr3467, 1 day ago

how to write hello world in python

Answers

Answered by Anonymous
4

In Python, we use the print statement to output text. The print statement used to print any message to the screen or print statement is used to print string into the console followed by a newline.

In python 2 we use print statement to print Hello world:

>>> print 'Hello world'

In python 3 we use print statement to print Hello world:

>>> print('Hello world')

Note that the text should be enclosed into single or double quotes. You have to use same type of quotes at the start and at the end. For example if you try to print this program;

>>> print("Hello world')

It will throw an error message since we started with a double quote and finished with a single quote around Hello world.

Answered by jaswasri2006
0

Python Hello World

  1. Write the Program. Open your Python editor (IDLE is fine), and enter the following codd : print("Hello World")
  2. Save your Program. Go ahead and save your program to a file called hello.py . This is typically done using the editor's File > Save or similar.
Similar questions