Search Header Logo
PYTHON - Built In Functions

PYTHON - Built In Functions

Assessment

Presentation

Computers

11th Grade

Practice Problem

Hard

Created by

Mansi Srivastava

Used 39+ times

FREE Resource

1 Slide • 23 Questions

1

PYTHON - Built In Functions

Recapitulation 

Slide image

2

Fill in the Blank

x="CBSE SCHOOL" ; print ( x [-2: 2 :-2] )

3

Fill in the Blank

What is the output of:-

msg="Jaipur is Pink City"

X=msg.split("i")

print(X)

#ignore indentation

[
'
'
,
'
'
,
'
'
,
'
'
,
'
'
]

4

Multiple Select

Select the statements which are true for Python function.

1

A function is a code block that only executes when it is called.

2

Python function always returns a value.

3

A function only executes when it is called and we can reuse it in a program

4

A function has to be defined before invoking it.

5

Multiple Choice

What is the output of the following function call

def fun1(num):

.......return num + 25


fun1(5)

print(num)

# ....... denotes spaces

1

25

2

5

3

Name error

6

Multiple Choice

What is the output of the following string operations

str = "My salary is 17000";

print(str.isalnum( ))

1

True

2

False

7

Fill in the Blank

What is the output of the following statement:

print (True or False)

8

Multiple Choice

Which function will return the last three characters of string, name?

1

name [ 3 : ]

2

name [ : 3 ]

3

name [ -3 : ]

4

name [ : -3 ]

9

Multiple Choice

Select the correct output of the following String Operation:

str = 'Waah'

print ( str[ : 3 ] + 'Bhai' + str[ -3 : ] )

1

WaaBhaiaah

2

Waa Bhai aah

3

WaahBhaiWaah

10

Multiple Choice

What is the output of the following statement:

print(len(1) or True))

1

True

2

error

3

False

4

1

11

Multiple Choice

Select the correct output of the following String operations

str1 = "my isname isisis jameis isis bond"

sub = "is"

print(str1.count(sub, 4))

1

5

2

6

3

7

12

Multiple Choice

Which method should I use to convert String

"welcome to the world of python" TO

"Welcome To The Beautiful World Of Python"

1

Capitalize( )

2

upper( )

3

title( )

13

Multiple Choice

What is the output produced by the following statements:-

mycity = "Delhi, Lucknow, Jaipur, delhi, Chennai"

mycity.replace( 'Delhi' , ' Pune' )

1

' Pune, Lucknow, Jaipur, Pune, Chennai '

2

' Pune, Lucknow, Jaipur, delhi, Chennai '

3

' Delhi, Lucknow, Jaipur, delhi, Chennai '

4

' Delhi, Lucknow, Jaipur, Pune, Chennai '

14

Multiple Choice

What is the output of the statements:-

What is the output of the following string comparison

print("John" > "Jhon")

print("Emma" < "Emm")

1

True

False

2

True

True

3

False

False

4

False

True

15

Multiple Choice

Select the correct output of the following String operations

str = "my name is James bond"

print (str.capitalize( ))

1

my name is James bond

2

My Name Is James Bond

3

My name is James bond

4

TypeError: unsupported operand type(s)

16

Multiple Choice

What will be the output of following string operation:-

classlist = ' Anna, Kate, Becky, Kim, Charles'

classlist.index('John',2)

1

-1

2

0

3

ValueError

17

Multiple Choice

Select the correct output of the following String operation:

subject = 'Artificial Intelligence'

subject.startwith('Art')

1

True

2

False

3

0

18

Multiple Choice

Select the correct output of the following String operation:

s = 'money'

'$'.join(s)

1

'$money'

2

'm$o$n$e$y'

3

'money$'

4

'mo$n$ey'

19

Multiple Choice

Select the correct output of the following code:

s='Magic is Real'

s.istitle( )

1

False

2

True

3

'Magic Is Real'

20

Multiple Choice

Select the correct output of the String Operation:

s='ABRA-CADABRA'

s.find('Ab',1)

1

0

2

7

3

-1

4

5

21

Multiple Choice

What is the output of the following code statement :

print(len(181))

1

3

2

4

3

error

4

0

22

Multiple Choice

Select the output of the following code:

s='Every Little Helps!'

s.partition('tt')

1

'Every Li', 't', 'tle Helps!')

2

'Every Li', 'tt', 'le Helps!')

3

'Every' , 'Li', 't', 'tle, 'Helps!')

23

Multiple Choice

Select the correct output of the following code statements:

s=''

s.ispace()

1

True

2

False

24

Fill in the Blank

s= "hardwork is key"

L=s.partition("is")

s_new = L[1].capitalize() + L[2].upper() + "-".join(L[0])

print(s_new)

#ignore the indentation

-
-
-
-
-
-
-
-

PYTHON - Built In Functions

Recapitulation 

Slide image

Show answer

Auto Play

Slide 1 / 24

SLIDE