Search Header Logo

Python Quiz 4

Authored by Nguyen Duong

Computers

University

Python Quiz 4
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

90 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What arithmetic operators cannot be used with strings?

+

*

–

All of the mentioned

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following Python code? >>>print (r"\nhello")

a new line and hello

\nhello

the letter r and then hello

error

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following Python statement? >>>print('new' 'line')

Error

Output equivalent to print ‘new\nline’

newline

new line

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following Python statement? >>> print('x\97\x98')

Error

97 98

x\97

\x97\x98

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following Python code? >>>str1="helloworld" >>>str1[::-1]

dlrowolleh

hello

world

helloworld

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following Python code? print(0xA + 0xB + 0xC)

0xA0xB0xC

Error

0x22

33

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following Python code? class father: def __init__(self, param): self.o1 = param class child(father): def __init__(self, param): self.o2 = param >>>obj = child(22) >>>print "%d %d" % (obj.o1, obj.o2)

None None

None 22

22 None

Error is generated

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

Microsoft

Continue with Microsoft

or continue with

Facebook

Facebook

Apple

Apple

Others

Others

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?