
Kiểu xâu

Quiz
•
Science
•
University
•
Hard
Kiều Nguyễn
Used 1+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
Xâu rỗng là xâu có độ dài bằng:
0
1
2
3
2.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
Để biết độ dài của xâu s ta dùng hàm:
str(s)
len(s)
length(s)
s.len()
Answer explanation
3.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
Để thay thế kí tự ‘a’ trong xâu s bằng một xâu mới rỗng ta dùng lệnh:
s=s.replace(‘a’,’ ’)
s=s.replace(' ',‘a’)
s=replace(a,’’)
s=s.replace()
4.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Kết quả đoạn chương trình sau là gì?
S="0123456789"
T=" "
for i in range(len(S)):
T=S[i]+T
print(T)
‘02468’
‘13579’
‘0123456789’
‘9876543210’
5.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Kết quả đoạn chương trình sau là gì?
s='4ab56c7123def'
for i in s:
if i in '0123456789':
print(i,end=" ")
‘4567123’
‘0123456789’
‘abcdef’
‘4ab56c7123def’
6.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Sau khi thực hiện đoạn lệnh sau, biến kq sẽ có giá trị bao nhiêu?
s='123456789'
kq=' '
for i in s:
if int(i)%2==0:
kq=kq+i
‘13579’
‘2468’
‘123456789’
‘987654321’
7.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Sau khi thực hiện đoạn lệnh sau, biến count sẽ có giá trị bao nhiêu?
s='1a2b3c4d5e'
count=0
for ch in s:
if 'a'<=ch<='z':
abcde
12345
5
0
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
CSA03_CP2

Quiz
•
University
10 questions
Cánh tay Robot

Quiz
•
1st Grade - University
10 questions
Hệ thống SCADA là gì ?

Quiz
•
University
15 questions
Electric Potential and Energy Quiz

Quiz
•
University
10 questions
Quizz_Python_Basic_If_Elif_Else

Quiz
•
9th Grade - University
10 questions
BỘ CÂU HỎI SỐ 1

Quiz
•
9th Grade - University
11 questions
Quizz ERP

Quiz
•
University
10 questions
POTENCIAL ELECTRICO

Quiz
•
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