
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
20 questions
lesson #28
Presentation
•
12th Grade
17 questions
基督徒的愛情面面觀
Presentation
•
KG
21 questions
廉頗藺相如列傳
Presentation
•
10th - 12th Grade
18 questions
Unit 4 Review AP Bio
Presentation
•
11th - 12th Grade
20 questions
CME2 CHP 11 Idiom
Presentation
•
KG
19 questions
CME2 CHP 8 Idiom
Presentation
•
KG
19 questions
交通工具 1
Presentation
•
KG
20 questions
Lesson 8 New Words1
Presentation
•
10th - 11th Grade
Popular Resources on Wayground
5 questions
A Home on the Shore
Quiz
•
3rd Grade
28 questions
US History Regents Review
Quiz
•
11th Grade
6 questions
A Horse Tale
Quiz
•
3rd Grade
20 questions
Math Review
Quiz
•
3rd Grade
10 questions
Juneteenth History and Significance
Interactive video
•
5th - 8th Grade
20 questions
Dividing Fractions
Quiz
•
5th Grade
55 questions
A Long Walk to Water Final Review
Quiz
•
6th - 8th Grade
10 questions
Equation Word Problems
Quiz
•
7th Grade
Discover more resources for Computers
28 questions
US History Regents Review
Quiz
•
11th Grade
20 questions
Insurance
Quiz
•
9th - 12th Grade
10 questions
Juneteenth: History and Significance
Interactive video
•
7th - 12th Grade
10 questions
7.3-7.4 Quiz
Quiz
•
11th Grade
6 questions
Mayan Mathematics part 1
Presentation
•
9th - 12th Grade
40 questions
Flags of the World
Quiz
•
KG - Professional Dev...
10 questions
Unit 9 Quiz
Quiz
•
9th - 12th Grade
50 questions
US History Regents Practice Exam
Quiz
•
11th Grade