python quiz 4

python quiz 4

Professional Development

10 Qs

quiz-placeholder

Similar activities

Day3 - Python STT

Day3 - Python STT

Professional Development

10 Qs

Psicología del Color y Bocetos

Psicología del Color y Bocetos

Professional Development

15 Qs

HARDWARE, SOFTWARE Y SISTEMA OPERATIVO

HARDWARE, SOFTWARE Y SISTEMA OPERATIVO

Professional Development

10 Qs

Tema 2 Unidades funcionales

Tema 2 Unidades funcionales

Professional Development

10 Qs

TCH_Induction

TCH_Induction

Professional Development

12 Qs

Ciber Kill Chain

Ciber Kill Chain

Professional Development

10 Qs

1 - Introducing SCRUM in SAFe

1 - Introducing SCRUM in SAFe

Professional Development

10 Qs

Types of Mass Media

Types of Mass Media

10th Grade - Professional Development

11 Qs

python quiz 4

python quiz 4

Assessment

Quiz

Computers

Professional Development

Practice Problem

Medium

Created by

karthika karthika

Used 99+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Q.1. What is the output of this code?

a,b=1,0

a=a^b

b=a^b

a=a^b

print(a)

0

1

2

error

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

what is output of following code −

class Count:

def __init__(self, count=0):

self.__count=count

a=Count(2)

b=Count(2)

print(id(a)==id(b), end = '' '')


c= ''hello''

d= ''hello''

print(id(c)==id(d))

A - True False

B - False True

C - False False

D - True True

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code snippet?class Sales:

def __init__(self, id):

self.id = id

id = 100


val = Sales(123)

print (val.id)

A. SyntaxError, this program will not run

B. 100

C. 123

D. None of the above

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code snippet?class Person:

def __init__(self, id):

self.id = id


sam = Person(100)


sam.__dict__['age'] = 49


print (sam.age + len(sam.__dict__))

1

2

50

51

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following can be used to invoke the __init__ method in B from A, where A is a subclass of B?

A. super().__init__()

B. super().__init__(self)

C. B.__init__()

D. B.__init__(self)

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code snippet?class A:

def __init__(self):

self.calcI(30)

print("i from A is", self.i)


def calcI(self, i):

self.i = 2 * i;


class B(A):

def __init__(self):

super().__init__()

def calcI(self, i):

self.i = 3 * i;


b = B()

A. The __init__ method of only class B gets invoked.

B. The __init__ method of class A gets invoked and it displays “i from A is 0”.

C. The __init__ method of class A gets invoked and it displays “i from A is 60”.

D. The __init__ method of class A gets invoked and it displays “i from A is 90”.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is not a complex number?

a) k = 2 + 3j

b) k = complex(2, 3)

c) k = 2 + 3l

d) k = 2 + 3J

Create a free account and access millions of resources

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?