Đoạn chương trình sau có lỗi tại một dòng lệnh. Theo em, đó là lỗi ở câu lệnh nào:
# program to display student's marks from record
student_name = 'Soyuj'
marks = {'James': 90, 'Jules': 55, 'Arthur': 77}
for student in marks:
if student == student_name:
print(marks(student))
break
else:
print('No entry with that name found.')
Sai kí hiệu chú thích.
Sai khi khai báo danh sách.
Sai khi gọi tới phần tử của danh sách.
Không có lỗi sai ở câu lệnh nào.
Hãy suy nghĩ và trả lời câu hỏi trước khi xem đáp án
Sửa câu lệnh print(marks(student)) thành print(marks[student]), sử dụng dấu ngoặc vuông khi gọi tới từng phần tử của danh sách.
Tài liệu "Bộ Đề Kiểm Tra Học Kì II - Năm Học 2022-2023 - Tin Học 10" tổng hợp các đề kiểm tra từ các trường THPT trên toàn quốc, được biên soạn theo chương trình chuẩn. Đề thi bao gồm các dạng bài tập trắc nghiệm, tự luận, và thực hành, tập trung vào các chủ đề chính: hệ điều hành, các phần mềm ứng dụng, thuật toán cơ bản, lập trình với ngôn ngữ Python, và ứng dụng công nghệ thông tin trong giải quyết vấn đề thực tế.
Câu hỏi liên quan
Trong các dãy số cho bởi số hạng tổng quát \({{u}_{n}}\) sau đây, dãy số nào là cấp số cộng?
Khối lượng nguyên tử magnesium là 39,8271.10-27 kg. Khối lượng của magnesium theo amu là
Biểu hiện của đạo đức kinh doanh trong mối quan hệ giữa chủ thể sản xuất với khách hàng là gì?
Hãy chọn câu đúng : Chu kì dao động của con lắc lò xo là :
Khi soạn thảo, ban hành hay sửa đổi, bổ sung Hiến pháp phải tuân theo:
Chọn ý đúng: Môi trường sống của con người bao gồm những gì ?
Trong các thiết bị dưới đây, thiết bị nào là PDA?
Mệnh đề nào sau đây là mệnh đề sai?
Choose A, B, C or D to complete each sentence.
The tourists and the local people ____________ I have met are nice.
Cho tam giác \(A B C\), xét các bất đẳng thức sau:
I. \(|a-b|<c\).
II. \(a<b+c\).
III. \(m_{a}+m_{b}+m_{c}<a+b+c\).
Hỏi khẳng định nào sau đây đúng?
Cho các phương trình nhiệt hóa học sau:
1) CaCO3(s) → CaO(s) + CO2(g) \({{\Delta }_{r}}H_{298}^{0} = + 176,0\,kJ\)
(2) CH4(g) + 2O2(g) → CO2(g) + 2H2O(l) \({{\Delta }_{r}}H_{298}^{0} = - 890,0\,kJ\)
(3) C(graphite) + O2 (g) → CO2 (g) \({{\Delta }_{r}}H_{298}^{0} = - 393,5\,kJ\)
(4) Fe2O3(s) + 2Al(s) → Al2O3(s) + 2Fe(s) \({{\Delta }_{r}}H_{298}^{0} = - 851,5\,kJ\)
Số phản ứng thu nhiệt trong các phản ứng trên là
Nội dung của bài thơ Mùa xuân chín là gì?
Read the following passage about the A Vision of a Harmonious Multicultural Society and mark the letter A, B, C or D on your answer sheet to indicate the best answer to each of the following questions from 31 to 40.
By 2050, our world will have undergone remarkable transformations in how different cultures coexist. The walls that once divided nations are vanishing into thin air as global citizens embrace diversity like never before. Technology will serve as the great equalizer, with translation devices making language barriers a thing of the past. In urban centers worldwide, neighborhoods will showcase architectural influences from multiple cultures, creating spaces where everyone feels at home regardless of their background. Public spaces will feature gardens with plants from different continents, symbolic of how various cultures can thrive together in one environment.
[I] Education systems will prioritize cultural literacy alongside traditional subjects. [II] Schools will teach world history from multiple perspectives rather than through a single cultural lens. [III] Students will routinely participate in virtual exchange programs, allowing them to form friendships with peers around the world without leaving their classrooms. [IV] Government policies will recognize that a harmonious multicultural society requires institutional support, with resources allocated to community centers where cultural exchange happens organically through shared meals, festivals, and collaborative art projects.
Economic systems will evolve to value diverse approaches to business and innovation. Companies will actively seek employees from varied backgrounds, recognizing that diverse teams create more innovative solutions. Traditional knowledge from indigenous communities will be respected and incorporated into sustainable development practices. The entertainment industry will produce content that authentically represents multiple cultures, moving beyond stereotypes to show the complexity within each tradition. Digital platforms will help preserve endangered languages and cultural practices through accessible archives and learning tools.
The greatest achievement of this harmonious world will be a new understanding of human identity. People will identify with multiple cultural traditions simultaneously without feeling conflicted about their loyalties. Holidays from various traditions will be celebrated collectively, creating new hybrid celebrations that honor multiple heritages. The concept of "us versus them" will gradually fade as people recognize shared values across different traditions. While challenges will remain, the dominant attitude will be one of curiosity rather than fear when encountering differences.
Which of the following best summarises paragraph 3?
Nếu chọn ra 1 nam và 1 nữ làm trực nhật từ một tổ gồm 4 nam và 6 nữ thì có bao nhiêu cách?
Kết quả chung của các cuộc cách mạng tư sản thời cận đại là đều
Xác định ý đúng: Đặc điểm nào không đúng với vai trò của nội thương?
Mặc dù tiến lên chủ nghĩa tư bản, song Nhật Bản vẫn duy trì quyền sở hữu ruộng đất phong kiến. Tầng lớp quý tộc, đặc biệt là giới võ sĩ Samurai, vẫn có ưu thế về chính trị rất lớn. Họ chủ trương xây dựng Nhật Bản bằng sức mạnh quân sự. Tình hình đó làm cho đế quốc Nhật có đặc điểm là chủ nghĩa đế quốc phong kiến quân phiệt.
Cùng với sự phát triển của chủ nghĩa tư bản là sự bần cùng hóa của quần chúng nhân dân lao động. Công nhân Nhật Bản phải làm việc mỗi ngày từ 12 đến 14 giờ, trong những điều kiện rất tồi tệ mà tiền lương lại thấp hơn rất nhiều so với ở các nước châu Âu và Mĩ. Sự bóc lột nặng nề của giới chủ đã dẫn đến nhiều cuộc đấu tranh của công nhân đòi tăng lương, cải thiện đời sống, đòi quyền tự do, dân chủ.
Sự phát triển của phong trào công nhân là cơ sở cho việc thành lập các tổ chức nghiệp đoàn. Năm 1901, Đảng Xã hội dân chủ Nhật Bản được thành lập, dưới sự lãnh đạo Ca-tai-a-man Xen.
(Lịch sử thế giới cận đại)
Đâu là cơ sở thành lập các tổ chức nghiệp đoàn?
Read the passage carefully. Choose an option (A, B, C or D) that best answers each question from 23 to 30.
1. How do children learn about wildlife? And is what they learn the sort of thing they should be learning? It is my belief that children should not just be acquiring knowledge of animals but also developing attitudes and feelings towards them based on exposure to the real lives of animals in their natural habitats. But is this happening?
2. Some research in this area indicates that it is not. Learning about animals in school is often completely disconnected from the real lives of real animals, with the result that children often end up with little or no understanding or lasting knowledge of them. They learn factual information about animals, aimed at enabling them to identify them and have various abstract ideas about them, but that is the extent of their learning. Children's storybooks tend to personify animals as characters rather than teach about them.
3. For direct contact with wild and international animals, the only opportunity most children have is visiting a zoo. The educational benefit of this for children is often given as the main reason for doing it but research has shown that zoo visits seldom add to children's knowledge of animals – the animals are simply like exhibits in a museum that the children look at without engaging with them as living creatures. Children who belong to wildlife or environmental organizations or who watch wildlife TV programmes, however, show significantly higher knowledge than any other group of children studied in research. The studies show that if children learn about animals in their natural habitats, particularly through wildlife-based activities, they know more about them than they do as a result of visiting zoos or learning about them in the classroom.
4. Research has also been done into the attitudes of children towards animals. It shows that in general terms, children form strong attachments to individual animals, usually their pets, but do not have strong feelings for animals in general. This attitude is the norm regardless of the amount or kind of learning about animals they have at school. However, those children who watch television wildlife programs show an interest in and affection for wildlife in its natural environment, and their regard for animals in general is higher.
What can be inferred from paragraph 4 about children's attitudes to animals?
Chế độ Cộng hòa được thiết lập ở Bắc Mĩ theo quy định của Hiến pháp năm 1787 là chế độ gì?
Read the following passage and mark the letter A, B, C, or D on your answer sheet to indicate the best answer to each of the following questions from 20 to 27.
Traditional Media
Before the invention of newspapers, the main source of news was word of mouth. Any writings and drawings were done by hand. Although printing presses had existed in eastern Asia, it was Gutenberg’s invention in Europe in 1453 that made printing faster and books more accessible. It reduced the cost and size of printed books and made them the first form of mass media affordable to less wealthy people. Gutenberg’s invention also quickened the spread of discoveries and information, and promoted literacy in Europe.
The printing press led to the rise of printed newspapers that appeared regularly. The first newspapers developed from around 1612 and in a short period of time, they became very popular in Europe and the European colonies. In the 19th century, they also appeared in Asia.
Newspapers and magazines are still very popular today. Although most of them have online versions, many people continue to read print media, which is considered more credible than digital media.
In the 1920s, when radio, television, and video were introduced, the phrase “the media” began to be used. Black and white television quickly became popular in the 1950s, and in the 1960s colour broadcasts started in many countries. Thanks to its audiovisual presentation, television became one of the most important forms of mass media in the 20th century. As a source of news, entertainment, and education, it still attracts a large number of viewers today.
(Adapted from English Workbook 12 – Global Success)
Which of the following best paraphrases the underlined sentence in paragraph 1?