Create and Run Your First Python Program

这篇博客引导初学者通过三种方式运行Python,包括使用IDLE、命令行即时模式和执行Python文件。文章以打印'Hello World'为例,介绍了Python的基础语法,特别是`print()`函数的使用。通过这段简单的代码,读者可以完成他们的第一个Python程序并理解其输出。
摘要由CSDN通过智能技术生成

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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值