Now, the installation is completed. Let's see how to write our first Python program.
We can run Python by using the following three ways:
#1 Run Python using IDLE ( Integrated Development Environment )
#2 Run Python interactively using command line in immediate mode
#3 Execting Python file
Let's see how to write your first Python progam. Let's write a simple statement in Python to print the 'Hello World' on your computer screen.
You need to use print() function and write a message in its opening and closing brackets shown below.
A messge is a string that is a sequence of characters. In Python string are enclosed inside single quotes, double quotes, or triple quotes.
Program:
print('Hello World')
Output:
Hello World
Now, congratulations on your first Python program!
Keep it.
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)