wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

python_string

Total questions: 17

Worksheet time: 9mins

Name
Class
Date
1.

Quyidagi funksiyalardan biri Python String bilan ishlatilmaydi

a)

Split

b)

Remove

c)

print

d)

Replace

2.

Split funktsiyasining to'g'ri sintaksisini tanlang:

a)

x.split[]

b)

split(x)

c)

x.split(",", 3)

d)

X.SPLIT(",", 3)

3.

replace funktsiyasining to'g'ri sintaksisini tanlang:

a)

x.Replace(x)

b)

x.replace(y)

c)

x.replace(3,x)

d)

x.replace("j","3")

4.

10 ta yulduzli qatorni chop etish uchun to'g'ri kodni tanlang:

a)

print("**********")

b)

print("*"*10)

c)

print("*"^10)

d)

print("*"+10)

5.

x qatori uchun len funktsiyasining to'g'ri sintaksisi:

a)

x.len()

b)

len[x]

c)

LEN[]

d)

len(x)

6.

x satrini katta harfga aylantirish uchun to'g'ri sintaksis:

a)

X.upper()

b)

upper(x)

c)

x.UPPER[ ]

d)

x.upper()

7.

myname qatorini kichik harfga aylantirish uchun to'g'ri sintaksis:

a)

myNAME.lower[ ]

b)

myname.lower( )

c)

myname.upper( )

d)

myname_lower(12 )

8.

Satrning boshida va oxirida mavjud bo'sh joylarni olib tashlash uchun funksiya

a)

split()

b)

len()

c)

strip()

d)

remove()

9.

x= "Python",

print(x.upper())

natija ?

a)

python

b)

PYTHON

c)

_PYTHON

d)

"PYTHON"

10.

x= "java"

print(x.replace("J","l") )

Natija ?

a)

java

b)

Error

c)

lava

d)

Lava

11.

x= "python is a high level language"

print(x[5].replace("n","*"))

Natija ?

a)

pytho* is a high level language

b)

python is a high level language

c)

*

d)

Error

12.

x= "python is a high level language"

print(len(x[-1]))

natija ?

a)

1

b)

31

c)

Error

d)

25

13.

x= "Python is a high level language"

print(x.replace(x[-3],"3"))

Natija ?

a)

Error

b)

Python is 3 high level l3ngu3ge

c)

Python is a high l3v3l languag3

d)

Python is a high level language

14.

x= "Python is a high level language"

print(x[2].upper()+x[3].lower()+x[-1])

natija ?

a)

THE

b)

The

c)

ThE

d)

the

15.

x= "Python is a high level language"

print(x[-4].upper()+x[8]+x[-1])

natija ?

a)

Use

b)

Age

c)

USE

d)

Error

16.

Natijada 6 chiqadigan kodni tanlang

a)

print(len("Python"))

b)

s="Python6"

print(s[-1])

c)

x= "Python"

print(x.replace("Python","6"))

d)

Hamma javob to`g`ri

17.

x= "Python"

print(x[0])

print(x[-1])

print(x[-2])

natija ?

(a)