
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
In the loop, when i is 3, jump directly to the next iteration.
Type answer...
17
Fill in the Blanks
Print a message once the condition is false.
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
24 questions
B4L7 Pattern
Presentation
•
11th Grade
15 questions
Computers and Devices
Presentation
•
KG - University
19 questions
Lesson7 Grammar
Presentation
•
10th Grade
24 questions
圓錐曲線複習
Presentation
•
11th Grade
19 questions
Lesson 13 仮定法過去、仮定法過去完了 復習
Presentation
•
11th Grade
18 questions
HIRAGANA (CHOUON TO SOKUON)
Presentation
•
10th Grade
22 questions
Characteristics of Handwriting
Presentation
•
10th - 12th Grade
20 questions
Grade 10 Lesson 8
Presentation
•
10th Grade
Popular Resources on Wayground
6 questions
PRIDE Always and Everywhere
Presentation
•
12th Grade
20 questions
Lab Safety Quiz
Quiz
•
6th Grade
26 questions
KOR Review Kahoot Questions
Quiz
•
8th Grade
21 questions
Continents and Oceans
Quiz
•
6th Grade
12 questions
Unit Zero lesson 2 cafeteria
Presentation
•
9th - 12th Grade
20 questions
Parts of Speech
Quiz
•
5th Grade
10 questions
Riddles Riddles fun Riddles
Quiz
•
6th - 12th Grade
16 questions
Subject & Predicate
Quiz
•
5th Grade