Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. What is the output and why ? class Sales: def __init__(self, id): self.id = id id = 100 val = Sales(500) print (val.id) a.

1. What is the output and why ?

class Sales: def __init__(self, id): self.id = id id = 100 val = Sales(500) print (val.id)

a. the result will be "500" because id is declared as an instance variable

b. Nothing will be printed

c. the script will result error

d. the result will be "500, because id is declared as a class variable

2. The variable defined on line 3 is an example of a __________ variable.

1 #!/usr/bin/python 2 import Onett 3 plater='Ness' 4 class Adventure(Onett): 5 __score=0 

a. local

b. global

c. private

d. public

3. Without a visibility modifier, class and instance variables are declared as;

a. private

b. public

c. global

d. protected

4. In an object-oriented inheritance model child classes are derived from parent classes and inherit ???

a. class variables

b. class function

c. methods and functions

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

MFDBS 89 2nd Symposium On Mathematical Fundamentals Of Database Systems Visegrad Hungary June 26 30 1989 Proceedings

Authors: Janos Demetrovics ,Bernhard Thalheim

1989th Edition

3540512519, 978-3540512516

More Books

Students also viewed these Databases questions

Question

What is the preferred personality?

Answered: 1 week ago

Question

What is the relationship between humans?

Answered: 1 week ago