Create and Run Your First Python Program

Create and Run Your First Python Program,第1张

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.

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/918021.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-16
下一篇 2022-05-16

发表评论

登录后才能评论

评论列表(0条)

保存