Search Header Logo

Python Quiz Day-4

Authored by SANJANA TUMPATI

Computers

University

Python Quiz Day-4
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code?

python

print("Hello, World!"[7])

H

W

o

,

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which method can be used to convert a string to lowercase?

lowercase()

toLower()

lower()

downcase()

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the `split()` method do?

Splits the string into a list where each word is a list item

Splits the string into a list where each character is a list item

Splits the string into a list based on a delimiter

Both a and c

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the result of the following code?

"hello".capitalize()

Hello

HELLO

hello

HeLLo

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is not a valid string method in Python?

find()

replace()

append()

strip()

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code?

s = "Python Programming"

print(s[2:8])

thon P

ython P

thon Pr

ython Pr

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the correct syntax to define a function in Python?

function myFunction():

def myFunction:

def myFunction():

function myFunction()

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