Search Header Logo

BÀI 25: MỘT SỐ LỆNH LÀM VIỆC VỚI XÂU KÍ TỰ

Authored by Việt Nam

Computers

12th Grade

Used 2+ times

BÀI 25: MỘT SỐ LỆNH LÀM VIỆC VỚI XÂU KÍ TỰ
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

9 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

   Kết quả của các câu lệnh sau là gì?

s = "12 34 56 ab cd de "

print(s. find(" "))

print(s.find("12"))

print(s. find("34"))

2,0,3

2,1,3

3,5,2

1,4,5

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

   Phát biểu nào sau đây là đúng khi nói về các phương thức trong python?

Python có một lệnh đặc biệt dành riêng cho xâu kí tự.

Cú pháp của lệnh find là: <xâu mẹ>. Find(<xâu con>).

Lệnh find sẽ tìm vị trí đầu tiên của xâu con trong xâu mẹ.

Câu lệnh find có một cú pháp duy nhất.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Lệnh sau trả lại giá trị gì?

>> “abcdabcd”. find(“cd”)

>> “abcdabcd”. find(“cd”, 4)

2, 6.

 3, 3.

2, 2.

2, 7.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Lệnh nào sau đây dùng để tách xâu:

split()

join()

remove()

copy()

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Kết quả của chương trình sau là gì?

>>> s = “Một năm có bốn mùa”

>>> s.split()

>>> st = “a,b,c,d,e,f,g,h”

>>> st.split(“,”)

‘Một năm có bốn mùa’, [‘a’, ‘b’, ‘c’, ‘d’, ‘e’, ‘f’, ‘g’, ‘h’].

[‘Một’, ‘năm’, ‘có’, ‘bốn’, ‘mùa’],

[‘a’, ‘b’, ‘c’, ‘d’, ‘e’, ‘f’, ‘g’, ‘h’].

‘Một năm có bốn mùa’, ‘abcdefgh’

[‘Một’, ‘năm’, ‘có’, ‘bốn’, ‘mùa’], ‘abcdefgh’.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Kết quả của chương trình sau là gì?

a = "Hello"

b = "world"

c = a + " " + b

print(c)

hello world.

Hello World.

Hello word.

Helloword.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Hoàn thành câu lệnh sau để in ra chiều dài của xâu:

x = "Hello World"

print(…)

x. len()

len(x)

copy(x)

x. length()

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Microsoft

Continue with Microsoft

or continue with

Facebook

Facebook

Apple

Apple

Others

Others

Already have an account?