bài 9 trang 36 tin học 11 bằng python

thienthaohola

New member
## Bài 9 Trang 36 Tin học 11 trong Python

### 1. Mục tiêu học tập

* Tìm hiểu cách sử dụng hàm `range ()` để tạo chuỗi số.
* Tìm hiểu cách sử dụng vòng `for` để lặp qua một chuỗi các số.
* Tìm hiểu cách sử dụng câu lệnh `if` để kiểm tra một điều kiện.
* Tìm hiểu cách sử dụng câu lệnh `other` để thực thi mã khi không đáp ứng điều kiện.
* Tìm hiểu cách sử dụng câu lệnh `break` để thoát khỏi vòng lặp sớm.

### 2. Hướng dẫn

1. Mở [Tin học 11 trong Python] (https://www.khanacademy.org/computi...amming/python/information-11/a/lessson-9-9-36) Bài học trong Khan Academy.
2. Xem video và đọc hướng dẫn.
3. Thực hiện theo các bước trong bài tập để thực hành những gì bạn đã học.

### 3. Ví dụ

`` `Python
# Tạo một chuỗi các số từ 1 đến 10.
Số = Phạm vi (1, 11)

# Lặp lại theo chuỗi số.
cho số trong số:
# In số.
in (số)

# Kiểm tra xem số có chẵn không.
Nếu số % 2 == 0:
# In "Số là chẵn."
in ("số là chẵn.")
khác:
# In "Số là lẻ."
in ("Số là lẻ.")

# Thoát khỏi vòng lặp nếu số là 5.
cho số trong số:
Nếu số == 5:
phá vỡ
# In số.
in (số)
`` `

### 4. Kết luận

Trong bài học này, bạn đã học được cách sử dụng hàm `range ()`, vòng `for`, câu lệnh` if`, câu lệnh `other` và câu lệnh` break`.Bạn có thể sử dụng các khái niệm này để viết các chương trình thực hiện nhiều nhiệm vụ khác nhau.

### 5. Hashtags

* #Python
* #Programming
* #khoa học máy tính
* #Khanacademy
* #giáo dục
=======================================
## Lesson 9 page 36 Informatics 11 in Python

### 1. Learning Objectives

* Learn how to use the `range()` function to create a sequence of numbers.
* Learn how to use the `for` loop to iterate over a sequence of numbers.
* Learn how to use the `if` statement to check for a condition.
* Learn how to use the `else` statement to execute code when a condition is not met.
* Learn how to use the `break` statement to exit a loop early.

### 2. Instructions

1. Open the [Informatics 11 in Python](https://www.khanacademy.org/computing/computer-science/programming/python/information-11/a/lesson-9-page-36) lesson in Khan Academy.
2. Watch the video and read the instructions.
3. Follow the steps in the exercise to practice what you have learned.

### 3. Examples

```python
# Create a sequence of numbers from 1 to 10.
numbers = range(1, 11)

# Iterate over the sequence of numbers.
for number in numbers:
# Print the number.
print(number)

# Check if the number is even.
if number % 2 == 0:
# Print "The number is even."
print("The number is even.")
else:
# Print "The number is odd."
print("The number is odd.")

# Break out of the loop if the number is 5.
for number in numbers:
if number == 5:
break
# Print the number.
print(number)
```

### 4. Conclusion

In this lesson, you learned how to use the `range()` function, the `for` loop, the `if` statement, the `else` statement, and the `break` statement. You can use these concepts to write programs that perform a variety of tasks.

### 5. Hashtags

* #Python
* #Programming
* #ComputerScience
* #Khanacademy
* #education
 
Join ToolsKiemTrieuDoGroup
Back
Top
AdBlock Detected

We get it, advertisements are annoying!

Sure, ad-blocking software does a great job at blocking ads, but it also blocks useful features of our website. For the best site experience please disable your AdBlocker.

I've Disabled AdBlock