Describe the scope of the variables in this code.

class pet:
def __init__(self,strSpecies,strName):
self.species = strSpecies
self.petName = strName

def __str__(self):
return self.species + " named " + self.petName

def changeName(self, newName):
self.petName = newName

class petCarrier:
size = 'medium'
color = 'red'

The scope of petName ______.

The scope of color is ______.

Accessible to the entire program
limited to the petCarrier class
limited to the pet class


(both of the blanks need one of those answers)

Answers

Answer 1

The scope of petName is local to the class pet.

The scope of color is accessible by all parts of the program.

How to interpret programming variables?

The variable petName is local to the class; This isdue to the fact that the variable was created in a function whose name begins with two underscores.

The variable color; This is created in the petCarrier class and is accessible to the entire function. This was not created in a function whose name begins with an underscore.

Read more about programming variables at; https://brainly.com/question/9238988

#SPJ2

Answer 2

Answer:

The scope of petName limited to the pet class

The scope of color is accessible to the entire program

Explanation:

edge


Related Questions

Which technique will you use to make listening to audio a pleasant experience?
Audio _____ is the smooth shift of one audio file into another.

Answers

Don't quote me on this, but I *think* the answer is "Audio transition/transitioning is the smooth shift of one audio file into another." I hope I was able to help and I apologize if I was wrong. ♡♡

Answer:

Sample response: Good thriller has beginning, middle, and end. Reader has to care about the characters. A character should be mysterious so readers are interested. Crime is a good way to talk about human condition. Good thrillers change people’s point of view in some way.

Explanation:

Eric would like to have a callout text box that makes it look as if the character in an image is speaking. Which object should he insert into the Word document?
standard text box
WordArt
callout
shape
picture

Answers

Answer:

C: Callout shape

Explanation:

The object that should he insert into the Word document is the callout function. The correct option is b.

What is Microsoft Word?

A component of Microsoft Office is Microsoft Word. The office is a collection of Microsoft products that can be used on Windows or macOS and contains Word, PowerPoint, Excel, Outlook, and numerous other tools for both private and professional usage. They aren't the same thing; Microsoft Word is merely one of such app.

A callout function is one of the functions that specifies a callout and is implemented by a callout driver.

The following collection of callout functions makes up a callout: a notification processing notifying function. A function called classifying handles classifications.

Therefore, the correct option is b. callout.

To learn more about Microsoft Word, refer to the below link:

https://brainly.com/question/2579888

#SPJ5

Which loop prints the numbers 1, 2...100?

c = 1

while (c <= 100):
c = c + 1
print (c)

c = 1

while (c < 100):
c = c + 1
print (c)

c = 1

while (c <= 100):
print (c)
c = c + 1

c = 1

while (c < 101):
c = c + 1
print (c)

Answers

Answer:

while (c <= 100):

print (c)

c = c + 1

Explanation:

We can cancel out the while loops with ' < ' because then it won't print when C is 100.

while (c <= 100):

print (c)

c = c + 1

Is probably right because unlike the other while loop with ' <= ' it has a print statement before the C = C + 1 which means look at this:

C = 1

print(c)

C = C + 1

So when it's run 1 is printed

But when doing the other while loop:

c = 1

while (c <= 100):

print (c)

c = c + 1

C = 1

c = c + 1

print(c)

It prints 2 because it added 1 to C first before actually printing it.

The loop that prints the numbers 1, 2...100 is

c = 1

while (c <= 100):

   print (c)

   c = c + 1

We are to find the loop that prints the numbers 1 , 2 …100.

Therefore, the loop that print 1 to 100 can be represented as follows:

c = 1

while (c <= 100):

   print (c)

   c = c + 1

c is a variable initialize with zero.

The while loop is used to check if c is less than or equals to 100.

If c is less than or equal to 100 we print the value of c .

Then we add 1 to c and go back to the loop again.

learn more on loop here: https://brainly.com/question/19705987?referrer=searchResults

Other Questions
Which sentence is punctuated correctly?I will get on the bus soon; I should be home before lunch.Many people like both dogs and cats: the animal shelter has plenty of both of them.Don't be surprised if it snows it snows almost every day here in the winter.Many people like to play soccer, soccer has become very popular with children. PLZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ HELPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP!!!!!We know our lands are now become more valuable: the white people think we do notknow their value; but we are sensible that the land is everlasting, and the few goodswe receive for it are soon worn out and gone. For the future we will sell no lands butwhen Brother Onas [the proprietor of Pennsylvania] is in the country; and we will knowbeforehand the quantity of the goods we are to receive. Besides, we are not well usedwith respect to the lands still unsold by us. Your people daily settle on these lands, andspoil our huntingIf you have not done anything, we now renew our request, and desire you will informthe person whose people are seated on our lands, that that country belongs to us, inright of conquest; we having bought it with our blood, and taken it from our enemiesin fair warIt is customary with us to make a present of skins whenever we renew our treaties. Weare ashamed to offer our brethren so few; but your horses and cows have eat the grassour deer used to feed on. This has made them scarce, and will, we hope, plead in excusefor our not bringing a larger quantity: if we could have spared more we would have givenmore; but we are really poor; and desire youll not consider the quantity, but, few as theyare, accept them in testimony of our regardOur wise forefathers established union and amity between the ve nations [IroquoisNation]. This has made us formidable. This has given us great weight and authoritywith our neighboring nations. We are a powerful Confederacy, and by your observingthe same methods our wise forefathers have taken you will acquire much strength andpower; therefore, whatever befalls you, do not fall out with one another.QUESTION: In what ways does the document describe issues of power, wealth, or morality?Be sure to cite evidence from the document that supports your answer and explain why it supports your answer. Use the RADD process to help answer this question. Write a compound inequality that represents the following phrase.all real numbers that are between -4 and 8A. -4< n Where are alkaline earth metals found on the periodic table?Group 1Group 2Groups 312Group 17 In the past, the mean running time for a certain type of flashlight battery has been 9.7 hours. The manufacturer has introduced a change in the production method and wants to perform a hypothesis test to determine whether the mean running time has increased as a result. The hypotheses are: H 0: = 9.7 hours H a: > 9.7 hours where is the mean running time of the new batteries . Explain the meaning of a Type I error. how many elements are found in the third period. A.2 B.18 C.8 D.32 1. What phrase did Edward Bernays contribute to the Versailles Peace Treaty? How did thatexperience lead to his idea for a new peacetime company? What did he label this newfield and why did he choose that language? A migrating bird flies 42 miles in 3 hours. How many miles does it fly in 5 hours? if we say local materials What is an nucleus ? Sort the tiles under the correct headings to compare the two South American empires.Practiced terrace farmingChavnsIncasBuilt a major road systemBuilt a large empirePioneered artistic techniquesUnified tribes under one religion What do you think the word smart mean ?Help pls How many men did it take to capture Antigone?A:2B:5C:1D:7 Junior's brother is 1\dfrac121 2 1 1, start fraction, 1, divided by, 2, end fraction meters tall. Junior is 1\dfrac151 5 1 1, start fraction, 1, divided by, 5, end fraction of his brother's height. FREE BRAINLIEST AND EXTRA POINTS!!!!Which of the following presidential powers, do you suppose, is used most frequently?a.) request impeachment proceedings against federal judgesb.) declare warc.) approve or veto laws passed by Congressd.) appoint advisors A local restaurant only sells burgers and cokes. 3 burgers and 5 comes cost $17, while 6 burgers and 9 cokes cost $33. Whats the price of a burger? f(x)=x^2-4x-12 on (0,6) What is the slope of the line? A reversible reaction is said to be in equilibrium whenA)all reactions stop leaving some reactant unused.B)the reaction goes to completion and no reactants are left.9)the rate of the backward reaction equals the rate of the forward reaction.D)the reaction rate of the backward reaction becomes larger than the rate ofthe forward reaction. HELP!!! The probability that a males foot is between 10 and 12.5 inches is__ p(10