Python learning by case study@[April] (跟着April用真实案例学Python) Lesson two “PRINT( .format())”

Python learning by case study@[April]
(跟着April用真实案例学Python)

Lesson two 第二讲
Python is one of the most popular programming languages in the world. It is necessary to grasp it before entering the workplace.

Python是世界上最流行的编程语言之一。 在进入职场前大家都有必要掌握这门语言。

TODAY’S FOCUS–“PRINT( .format())”

As you known from lesson one, we could not directly print two variables together if these two belong to different data formats.
从第一课中知道,不能直接将不同类型的数字结构相加后打印输出。

Today, we will learn print( .format()), to overcome the problem above.
今天我们学习print( .format())来解决上面的问题。

First, look at the following code:
首先,看下下面的代码:

case 1 print format
The output of the code is below:
运行结果如下:
case 1 output
Second, inside format, you could directly calculate the number.
在format里面,数字可以直接计算。

look at the following code:
看下下面的代码:
case 2 format
The output of the code is below:
运行结果如下:
case 2 output
So, you have learnt python ‘print( .format())’ in today’s lesson. See you next time.
今天,这节课里你学会了用print( .format())。下节课再见啦~
case 3
case 3 output

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值