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

Why do you usually find domain names instead of IP addresses in a URL? Select one: a. An IP address would make your web page load more slowly b. A domain name is easier to remember C. An IP address is not guaranteed to get you to the right server computer d. Domain names are free, while IP addresses are very expensive ​

Answers

Answer:

b

Explanation:

for exaple brainly.com is easy to remember instead of 104.17.73.91

Which statement best describes the pros and cons of lack of regulation for cloud-based technology? Lack of regulation enables people to collaborate without the extra cost of paying a service provider; however, there is an increased opportunity for cybercrime. Lack of regulation speeds up the process of invention, but requires individuals to back up their own data. Lack of regulation encourages open innovation, but is not always secure. Lack of regulation encourages greater collaboration, but can lead to increased cost from price increases.

Answers

Answer:

3.) Lack of regulation encourages open innovation, but is not always secure.

Explanation:

Got it right in Introduction to Careers in Arts, A/V Technology and Communications

A company was asked to develop a smartphone app to help people locate a car of their choice to purchase from a complex of more than thirty used car dealers who all share a huge car lot. Name two features that that would be useful to potential customers.

Answers

Answer:

the gps and a map

Explanation:

Answer:

I think. it could be GPS and maps to but I may be wrong so yeah

To prevent the header from appearing on the title page of your document, select the______ option .
a. Different Odd and Even Pages
b. Different First Page
c. Position Grouping
d. Page Number​

Answers

Answer:

b. Different First Page

What is a product of respiration

Answers

Answer:

carbon dioxide and water

Explanation:

Compare and contrast the advantages and disadvantages of the Windows, Apple and Linux operating systems.

Answers

In apple, you may do other things that windows can not provide. Yet, Windows are good aswell since it has better things than apple. I’m so sorry if i’m wrong.

List any ten keyboard symbols.​

Answers

Answer:

Esc- Esc (escape) key.

F1 - F12 What are the F1 through F12 keys?

F13 - F24 Information about the F13 through F24 keyboard keys.

Tab Tab key.

Caps lock- Caps lock key.

Shift- Shift key.

Ctrl - Control key.

Fn- Function key.

Alt- Alternate key (PC only; Mac users have an Option key).

Spacebar- Spacebar key.

Hope this helps, have a great day/night, and stay safe!

delete temp or %temp% files in Windows 10 is safe and, can it help boost up your PC fps?

yes or no

Answers

Answer:   yse

Explanation...

Other Questions
Identify the subject. My father built a new shed in the back yard.fatherbuiltshedyard I need to find the x pls help and show work Write the missing exponent. If 24 = 118, what is the measure of each of the otherangles? Was im deutschen Alltag ist fr Auslnder ungewhnlich?I'm Swiss German go to Uni at CalTech I WILL GIVE BRAILYEST!!!!!What are the solutions to y=5x235x+30?What are the solutions to y=2x2+16x+30?What are the solutions to y=6x248x+42? Please answer quick !!!!! 1 You hear a young singer talking about his childhood. What is he grateful for? being encouraged to sing by his father. being exposed to music at an early age. inheriting his mother's talent as a singer. During the High Middle Ages (100-1300), why did France and England form unified states while Germany remained divided Name a storage protein in our bodies.Explain the function of this storage protein in our bodies.Where is this storage protein found?please help Olivia can type 45 words every 2.5minutes. What is the unit rate of wordsper minute that Olivia can type?What would be the rate of words per second? Write the word sentence as an equation. Then solve.The quotient of a number x and 1.5 is 21.Equation: Question 2Solution: x= Please help thanks!If a cone has a volume of 75.36 cubic feet and a radius of 6 feet, what is the height of the cone? (Use 3.14 for .)2 feet3.46 feet6 feet4 feet 5. Ellen wants to rent a bike. They charge a $12 servicefee plus $16 per hour and she can spend at most $140,how many hours can she rent the bike? Hi everyone! I have a fun question. If you could have one thing in the world, what would it be? Happy Holidays! -Cassie 9 Select the correct answer. Conservation agents object to legal hunting. OA True B. False Pls help im being timed) compare the original DNA i genuinely don't understand . please help me asap An adult ticket for hypnotist's show cost $15. A children's ticket for the hypnotist's show cost $9. The number of adult tickets sold 5 more times the number of children's ticket sold. A total of $1512 is taken in for ticket sales. How many of each type of ticket is sold.1. 21 adult tickets and 110 children's tickets2. 110 adult tickets and 22 children's tickets3. 10 adult tickets and 90 children's tickets4. 10 adult tickets and 18 children's tickets The horse trotted across the open field.