Phát biểu nào sau đây là sai?
Ôn tập B24. Xâu kí tự

Quiz
•
Computers
•
10th Grade
•
Medium
Trần Hiếu
Used 9+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Có thể truy cập từng kí tự của xâu thông qua chỉ số.
Chỉ số bắt đầu từ 0.
Có thể thay đổi từng kí tự của một xâu.
Python không có kiểu dữ liệu kí tự.
Answer explanation
Khác với danh sách, không thể thay đổi từng kí tự trong xâu.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Trong Python, câu lệnh nào dùng để tính độ dài của xâu s?
len(s)
length(s)
s.len()
s.length()
Answer explanation
Lệnh len() tính độ dài của xâu kí tự với cấu trúc len(list).
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Xâu “1234%^^%TFRESDRG” có độ dài bằng bao nhiêu?
16
17
18
15
Answer explanation
Đếm số kí tự trong cặp dấu nháy kép.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Biểu thức nào sau cho kết quả đúng hay sai?
S1 = “12345”
S2 = “3e4r45”
S3 = “45”
S3 in S1
S3 in S2
True, False.
True, True.
False, False.
False, True.
Answer explanation
Cả hai chuỗi S1, S2 đều chứa S3 nên hai biểu thức đúng.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
s = input("Nhập xâu kí tự bất kì:")
kq = False
for i in range(len(s)-1):
if s[i] == "2" and s[i+1] == "1":
kq = True
break
print(kq)
True
False
Chương trình bị lỗi
Vòng lặp vô hạn
Answer explanation
Chuỗi s chứa “21” nên kq = True.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Trong Python, xâu nào chương trình sẽ báo lỗi?
'This is a string in Python'
message = "This is also a string".
'"Beautiful is better than ugly.". Said Tim Peters'
Xâu không bị lỗi.
'It\'s also a valid string'
Answer explanation
Cả ba xâu đều đúng, có thể sử dụng “” trong ‘’ hoặc sử dụng kí hiệu “\” trong xâu.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Chương trình trên giải quyết bài toán gì?
s = ""
for i in range(10):
s = s + str(i)
print(s)
In một chuỗi kí tự từ 0 tới 10
In một chuỗi kí tự từ 0 tới 9.
In một chuỗi kí tự từ 1 tới 10.
In một chuỗi kí tự từ 1 tới 9.
Answer explanation
Biến i chạy từ 0 đến 9 trong range(10).
Create a free account and access millions of resources
Similar Resources on Quizizz
11 questions
KIỂU XÂU - PYTHON

Quiz
•
10th Grade
10 questions
trắc nghiệm tin

Quiz
•
10th Grade
10 questions
Xâu kí tự

Quiz
•
10th Grade
8 questions
CỦNG CỐ BÀI 24 TIN 10

Quiz
•
10th Grade
10 questions
Kiến thức về kiểu dữ liệu trong NNLT

Quiz
•
1st Grade - University
10 questions
Bài 24-Xâu kí tự

Quiz
•
10th Grade
10 questions
hoạt động khởi động _ bài 26 - Hàm trong Python

Quiz
•
10th Grade
10 questions
Bài 25-Một số lệnh làm việc với xâu kí tự

Quiz
•
10th Grade
Popular Resources on Quizizz
15 questions
Multiplication Facts

Quiz
•
4th Grade
20 questions
Math Review - Grade 6

Quiz
•
6th Grade
20 questions
math review

Quiz
•
4th Grade
5 questions
capitalization in sentences

Quiz
•
5th - 8th Grade
10 questions
Juneteenth History and Significance

Interactive video
•
5th - 8th Grade
15 questions
Adding and Subtracting Fractions

Quiz
•
5th Grade
10 questions
R2H Day One Internship Expectation Review Guidelines

Quiz
•
Professional Development
12 questions
Dividing Fractions

Quiz
•
6th Grade
Discover more resources for Computers
25 questions
Spanish preterite verbs (irregular/changed)

Quiz
•
9th - 10th Grade
10 questions
Juneteenth: History and Significance

Interactive video
•
7th - 12th Grade
8 questions
"Keeping the City of Venice Afloat" - STAAR Bootcamp, Day 1

Quiz
•
9th - 12th Grade
20 questions
Distance, Midpoint, and Slope

Quiz
•
10th Grade
20 questions
Figurative Language Review

Quiz
•
10th Grade
20 questions
Understanding Linear Equations and Slopes

Quiz
•
9th - 12th Grade