Python for loop

Quiz
•
Computers
•
12th Grade
•
Hard
จักรินทร์ ชื่นค้า
Used 12+ times
FREE Resource
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
จงเขียนโค้ด for loop ที่วนลูปผ่านลิสต์ [1, 2, 3, 4, 5]
for item in [1, 2, 3, 4, 5]: print(item)
for x in [1, 2, 3, 4, 5]:
for i in range(1, 6):
for num in [1, 2, 3, 4, 5]: print(num)
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
จงอธิบายความแตกต่างระหว่าง for loop แบบปกติ และ for loop ใช้กับลิสต์
for loop ใช้กับตัวแปร
for loop แบบปกติใช้กับลิสต์
ความแตกต่างคือ for loop แบบปกติใช้สำหรับการวนลูปที่มีจำนวนรอบที่ระบุไว้ล่วงหน้า ในขณะที่ for loop ที่ใช้กับลิสต์จะวนลูปตามจำนวนสมาชิกในลิสต์
for loop ใช้กับเงื่อนไข
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
for loop จะหยุดทำงานเมื่อเงื่อนไขใด?
เงื่อนไขไม่มี (null)
เงื่อนไขไม่ชัดเจน
เงื่อนไขเป็นจริง (true)
เงื่อนไขเป็นเท็จ (false)
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
จงเขียนโค้ด for loop ที่วนลูปผ่านลิสต์ ['apple', 'banana', 'cherry']
for fruit in ['apple', 'banana', 'cherry']: print(fruit)
for fruit in ['apple', 'banana', 'cherry']: print('fruit')
for i in range(3): print(['apple', 'banana', 'cherry'][i])
for item in ['apple', 'banana', 'cherry']: print(item)
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
จงอธิบายคำว่า 'iteration' ในบทเรียนนี้
Iteration คือกระบวนการที่ทำซ้ำโดยไม่มีการตรวจสอบเงื่อนไข
Iteration หมายถึงกระบวนการที่ทำซ้ำกลุ่มคำสั่งหรือขั้นตอนไปเรื่อย ๆ จำนวนครั้งที่กำหนดหรือจนกว่าเงื่อนไขที่กำหนดจะเป็นจริง
Iteration หมายถึงการทำงานครั้งเดียวแล้วสิ้นสุด
Iteration คือการทำงานที่ไม่มีการวนลูป
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
ผลลัพธ์คือ
1
1 3 5 7 9
2 4 6 8
1 2 3 4 5 6 7 8 9
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
ผลลัพธ์คือ
5
1 2 3 4
0 1 2 3 4
0 1 2 3 4 5
Create a free account and access millions of resources
Similar Resources on Wayground
20 questions
ตอบปัญหาคอมพิวเตอร์st

Quiz
•
9th - 12th Grade
21 questions
Mid Kidbright

Quiz
•
12th Grade
15 questions
Introduction to HTML (ปวช.1)

Quiz
•
10th - 12th Grade
15 questions
Hardware & Software

Quiz
•
8th - 12th Grade
20 questions
แบบทดสอบ วิทยาการคอมพิวเตอร์ กลางภาค

Quiz
•
9th - 12th Grade
15 questions
หน่วยที่ 5 การใช้โปรแกรมนำเสนอผลงาน

Quiz
•
12th Grade
20 questions
องค์ประกอบคอมพิวเตอร์...

Quiz
•
12th Grade
20 questions
Computer of Basic

Quiz
•
6th Grade - University
Popular Resources on Wayground
18 questions
Writing Launch Day 1

Lesson
•
3rd Grade
11 questions
Hallway & Bathroom Expectations

Quiz
•
6th - 8th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
Discover more resources for Computers
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
62 questions
Spanish Speaking Countries, Capitals, and Locations

Quiz
•
9th - 12th Grade
20 questions
First Day of School

Quiz
•
6th - 12th Grade
6 questions
Maier - AMDM - Unit 1 - Quiz 1 - Estimation

Quiz
•
12th Grade
21 questions
Arithmetic Sequences

Quiz
•
9th - 12th Grade
21 questions
9th Grade English Diagnostic Quiz

Quiz
•
9th - 12th Grade
7 questions
Characteristics of Life

Interactive video
•
11th Grade - University