Search Header Logo

ôn tập giữa kì 2: Xâu kí tự

Authored by Hiềm duongthihiem@gmail.com

Other

10th Grade

Used 4+ times

ôn tập giữa kì 2: 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

10 questions

Show all answers

1.

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(…)

 

len(x).

x. len().

copy(x).

x. length().

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Cho xâu s = “1, 2, 3, 4, 5”. Muốn xoá bỏ kí tự “,” và thay thế bằng dấu “ ” ta sử dụng lần lượt những câu lệnh nào?

remove() và join().

del() và replace().

split() và join().

split() và replace().

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Cho xâu s = "Python". Muốn chuyển thành xâu s = "P y t h o n" ta cần làm sử dụng những câu lệnh:

split() và join().

split() và replace().

del() và replace().

replace().

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Chương trình sau cho ra kết quả là gì

greeting = 'Good '

time = 'Afternoon'

greeting = greeting + time + '!'

print(greeting)

‘GoodAfternoon’.

‘GoodAfternoon!’.

Chương trình báo lỗi.

‘Good Afternoon !’

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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

line = "Geek1 Geek2 Geek3"

print(line.split())

print(line.split(' ', 1))

['Geek1', 'Geek2', 'Geek3']

['Geek1', 'Geek2 Geek3'].

['Geek1', 'Geek2', 'Geek3']

['Geek1', 'Geek2', 'Geek3'] .

['Geek1 Geek2', 'Geek3']

['Geek1', 'Geek2', 'Geek3'].

['Geek1 Geek2', 'Geek3']

['Geek1', 'Geek2 Geek3'].

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Lệnh sau trả lại giá trị gì? "0123456789".find("012abc")

  -1.

   0.

1.

Báo lỗi.

7.

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.

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

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?