Python learning by case study@[April] (跟着April用真实案例学Python) Lesson six “for loop”循环

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

Lesson six 第六讲
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–“for loop”
今日学习:for loop 循环 条件

First, if we want to print the following result, what can we do with for loop?
首先,看下下面的输出结果,我们应该怎么用循环语句?

1X1=1
1X2=2
1X3=3
1X4=4
1X5=5
1X6=6
1X7=7
1X8=8
1X9=9

The code is below, but there is a error inside, could you find it?
代码如下,但是里面有错误,你发现了吗?
case1-for loop
case1-for loop -output
You may notice that the ‘1X9=9’ did not show on the screen.
你也许注意到了,输出结果里少了1X9=9.

So, how to change the code?
那么应该如何更正代码呢?

case1-for loop
case1-for loop
Let’s have look at another example. The result is according to the user’s input number.
我们再看一个例子,这次是根据用户自己输入的数字,来确定计算到9乘以几。
case 2-for loop
case 2 for loop output
So, you have learnt python ‘for loop’ in today’s lesson. See you next time.
今天,这节课里你学会了python里的 ‘for loop’循环 。下节课再见啦
case3-for loop
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值