Search Header Logo

Kiểu xâu

Authored by Kiều Nguyễn

Science

University

Used 1+ times

Kiểu xâu
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

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

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?