Python Quiz 4

Python Quiz 4

University

90 Qs

quiz-placeholder

Similar activities

JS INTRO

JS INTRO

University

90 Qs

PRELIMINARY EXAMINATION [OOP]

PRELIMINARY EXAMINATION [OOP]

University

85 Qs

Teste HCIA-AI T1

Teste HCIA-AI T1

University

86 Qs

CS 241 Practice Test Week 4

CS 241 Practice Test Week 4

9th Grade - University

86 Qs

Quiz-1-22BCA2-Group-B-Web-development

Quiz-1-22BCA2-Group-B-Web-development

University

92 Qs

java Files & Serialize

java Files & Serialize

University

92 Qs

Data Analysis with Python

Data Analysis with Python

University

95 Qs

Activity 3.1 - Data Structures and Algorithms

Activity 3.1 - Data Structures and Algorithms

University

85 Qs

Python Quiz 4

Python Quiz 4

Assessment

Quiz

Computers

University

Hard

Created by

Nguyen Duong

FREE Resource

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

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?