
Python教學(2) if for while
Presentation
•
Computers
•
11th Grade
•
Hard
桂初 鄭
Used 3+ times
FREE Resource
18 Slides • 8 Questions
1
Python教學(2)
2
IF Statement
3
IF Statement
Python supports the usual logical conditions from mathematics:
Equals: a == b
Not Equals: a != b
Less than: a < b
Less than or equal to: a <= b
Greater than: a > b
Greater than or equal to: a >= b
4
IF Statement
if
if...else
if...elif...else
5
IF (單向)
6
IF...ELSE...(雙向)
7
IF...ELIF...(多重條件)
8
IF...ELIF...ELSE(多重條件)
9
Multiple Choice
圖中的程式能否正確執行?
可正常執行
無法執行
10
Multiple Choice
圖中的程式能否正確執行?
可正常執行
無法執行,
因缺少了標點符號
無法執行,
因if 條件句缺少了縮排
11
Multiple Choice
執行圖中的程式結果為何?
印出A
印出B
沒有印出任何結果
12
While Loops
while 條件
執行程式
13
While Loops
14
While Loops---break
結果:
1
2
3
15
While Loops---break
結果:
1
2
4
5
6
16
Fill in the Blanks
Type answer...
17
Fill in the Blanks
18
For Loops(列印lists中的元素)
19
For Loops(列印字串中的字母)
20
For Loops(列印字串中的字母)
21
For Loops(列印數字範圍)
Note that range(6) is not the values of 0 to 6, but the values 0 to 5.
22
For Loops(列印數字範圍)
range(2, 6), which means values from 2 to 6 (but not including 6):
23
Multiple Choice
執行圖中的程式結果為何?
Exit the loop when x is "cherry"
Only print "apple"
Print "apple" and "banana"
Print all elements
24
Multiple Choice
執行圖中的程式結果為何?
Exit the loop when x is "cherry"
Only print "apple"
Print "apple" and "banana"
Print all elements
25
Multiple Choice
執行圖中的程式結果為何?
0
1
2
3
1
2
3
4
2
3
4
5
3
4
5
6
26
For inner Loops(巢狀回圈)
Python教學(2)
Show answer
Auto Play
Slide 1 / 26
SLIDE
Similar Resources on Wayground
17 questions
高二 第三课《学汉语》 课文
Presentation
•
11th Grade
23 questions
春雷【俳句】①
Presentation
•
11th Grade
22 questions
Karel Exam 2.1 - 2.9
Presentation
•
12th Grade
16 questions
Lesson1 文法
Presentation
•
11th Grade
22 questions
so... that... / such... that...
Presentation
•
10th - 12th Grade
21 questions
KANJI 12
Presentation
•
KG
23 questions
[Digest][Nov][W1] U2 Gamification
Presentation
•
11th Grade
21 questions
古晋海唇街
Presentation
•
10th - 11th Grade
Popular Resources on Wayground
24 questions
PBIS-HGMS Day 10
Quiz
•
6th - 8th Grade
10 questions
HCS SCI 03 Summer School Review 3
Quiz
•
3rd Grade
11 questions
Home Scope
Quiz
•
7th - 8th Grade
15 questions
HCS SCI 05 Summer School Assessment 3 Review
Quiz
•
5th Grade
35 questions
Lufkin Road Middle School Student Handbook & Policies Assessment
Quiz
•
7th Grade
18 questions
Geo 11.3 Area of Circles and Sectors
Quiz
•
9th - 11th Grade