In the program below, which two variables have the same scope?

def usernameMaker (strFirst, strLast):
return strFirst + strLast[0]


def passwordMaker (strA, numC):
answer = dogName[0:3]
return answer + str(numC)

# the main part of your program that calls the function
username = usernameMaker ('Chris', 'Smith')
dogName = 'Sammy'
favoriteNumber = 7
password = passwordMaker (dogName,favoriteNumber)

Answers

Answer 1

Answer:

The answer would be dogName and favoriteNumber.
Both these variables are part of the global scope. That is, not inside of any function. Is that a satisfying answer?


Related Questions

what effects have computers had on the practise?​

Answers

Answer:

new designs of vehicles and other transportation were made; entertainment became more entertaining, medical science made more cures for disease

Explanation:

Which layer is responsible for creating data frames?

Answers

Answer:

The data link layer.

Explanation:

In the OSI model, the second layer is responsible for the framing of data packets.

Given int n, return an int[] that contains the numbers 0, 1, .. n-1, n, n-1, ... 1, 0. For example, if n = 5, then the array should be 0, 1, 2, 3, 4, 5, 4, 3, 2, 1, 0.
Make sure its in the coding language Processing, Java, or Javascript

Answers

Answer:

// Given int n, return an int[] that contains the numbers 0, 1, .. n-1, n, n-1, ... 1, 0.

// For example, if n = 5, then the array should be 0, 1, 2, 3, 4, 5, 4, 3, 2, 1, 0.

function mirrorArray(max) {

 const firstHalf = [];  // initalize the first half (without max)

 let count = 0;  // we're gonna count up from 0 to the max

 

 while (count < max) {  // whilst the count is less than the max provided

   firstHalf.push(count);  // add the value of count to the array firstHalf

   count++;  // increment count by 1

 }

 const secondHalf = firstHalf.slice().reverse();

 // we first chane the .slice() method which has no arguments

 // this means we can copy our array before reversing it.

 // if we did firstHalf.reverse(), we'd end up changing what's inside firstHalf too.

 // we don't want that!

 

 return [...firstHalf, max, ...secondHalf];

 // ... is the spread operator

 // it is used to remove the square brackets [] from an array

 // for example:  ...[1, 2, 3]  becomes  1, 2, 3

}

console.log(mirrorArray(5));  // here we're calling our function, and providing a max of 5

Explanation:

Everything that needs explaining should be in the comments I've put in the code! If you need more help, please ask!

I decided to use JavaScript because I think it reduces the amount of extra code needed to get my intentions across to the computer.

P.S.: I've also attached a screenshot of my IDE because it can be hard to read code if it's not colored in!

Don't worry about the array's items being displayed above each other, it is just what my IDE does.

Other Questions
Which aspects of American society in the 1950s reinforced this image of American women?a.television programsc.advertisingb.magazine articlesd.all of the above Select the correct answer from each drop-down menu. complete the paragraph about the syrian civil war. unrest in syria began in 2011 as part of the arab spring protests. the war was between government forces and rebels. the united states called for government leader assad to step down. despite warnings from the united states, syria's leader began using weapons in damascus, killing 1,500 people, including many children. the united states and agreed on a deadline for removing these weapons from syria. help please I'm no good at this Use the zero product property to find the solutions to the equation x? + 12 = 7x.X= -4 orx= 34 or X = -3X=-30rX=4X=30rX=4 Answer ASAP! btw im not going to a site for the answer you scammer.and if you get it right I'll give brainliest 1.PART A: Read line 15 from the passage from The Odyssey:"Some demon calm'd the air and smooth'd the deep." Whatdoes the line describe?O A. The ship seems to be in danger.O B. Ulysses is enchanted by the Sirens.C. The weather has suddenly changed. D. Ulysses thinks he can see the Sirens. what is the difference between biology and anatomy? The cost of painting a wall that is 5 meters wide and 212 meters tall is $50. How many square meters can be painted for $1? Hello people ~In a region of constant potential(a) the electric field is uniform.(b) the electric field is zero.(c) there can be no charge inside the region.(d) both (b) and (c) are correct. What made the movie the boy in the striped pajamas interesting? Which industry makes up the largest percentage of this funds holdings? state the difference between a conductor and an insulator.[tex] \\ \\ \\ [/tex]thankyou ~ Which word fits the best in the blank below? Anna was __________ about claims that a herbal tea could cure her migraine. Find the perimeter of the stained-glass window if each small square is 6 in. ona side. Find the surface area of each prism 2cm8cm 8cm PLEASE HELP ME with this question How did America participate in World War II?The United States fought to keep democratic forms of government from spreading around the world. The United States led the free world in a struggle against oppressive governments. The United States worked to liberate the Jews from concentration camps. The United States remained isolated and resisted calls to actively enter the war. 15) A rehearsal where movements and groupings on the stage arepracticed.Blocking RehearsalDress RehearsalPrepared RehearsalWorking Rehearsal What excerpts from "the storyteller" indicate that the aunt is unaware of her flaws? select two options. "an aunt belonging to the children occupied one corner seat, and the further corner seat on the opposite side was occupied by a bachelor who was a stranger to their party, but the small girls and the small boy emphatically occupied the compartment." "come over here and listen to a story, said the aunt, when the bachelor had looked twice at her and once at the communication cord." "its a very difficult thing to tell stories that children can both understand and appreciate, she said stiffly. "i dont agree with you, said the bachelor. "perhaps you would like to tell them a story, was the aunts retort." "the aunt suppressed a gasp of admiration." "a most improper story to tell to young children! you have undermined the effect of years of careful teaching." Why is peer review useful? A. Your peers might know your topic better than you do.B. If you wrote the paper, you wont be able to find anything wrong with it.C. A reviewer doesnt know what youre trying to say, so he or she can tell you what your report actually says.