Search Header Logo

Python Quiz 4

Authored by ENDURO SRM

Computers

University

Used 2+ times

Python Quiz 4
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

1 min • 1 pt

If str_1 = "Coders", which of the following codes will print ' r ' ?

print(str_1[4])

print(str_1[4:5])

print(str_1[-2])

All of these

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

What will be the output?

Pe

e

Pol

Peop

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

How can we print reverse of a string str_1 ?

str_1.reverse( )

str_1 [ : : -1 ]

reverse(str_1)

str_1 [ -1 : 0 ]

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which operator can be used to concatenate variable and values of any data type?

comma ( , ) operator

concatenate (+) operator

join operator

addition (+) operator

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What can be used to declare multi line comments?

triple quotes

( ''' .... ''' )

double quotes

( '' .... '' )

hash tag (#)

All of these

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the correct way to use len( ) function to find length of a string word1 ?

word1.len( )

len(word1)

str.len(word1)

string.len(word1)

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the correct way to use lower( ) method on a string word1 ?

word1.lower( )

lower(word1)

str.lower(word1)

string.lower(word1)

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?

Discover more resources for Computers