Answer:
Static scoping: x is 5
Dynamic scoping : x is 10.
Explanation:
Static scoping :
In static scoping the variable of a function take the value within the function.
If there is no values exist within the function then take the global value of the variable.
var x // No value is assigned to x so it check global value of x
function sub1() {
document.write(“x = “ + x + “”); // So it print x = 5
}
function sub2() {
var x;
x = 10;
sub1();
}
x = 5; // It is the global value of x
sub2();
Static scoping: x is 5
Dynamic scoping :
In Dynamic scoping the variable of a function take the value all the calling function ends.
If the global value is the last assigned value of a variable then it take that value.
If there exist some other function after global variable value if that function contain the variable with some assigned value variable take that value.
var x
function sub1() {
document.write(“x = “ + x + “”);
}
x = 5; // At this point x value is 5 and check there exist a function
sub2(); // So now call this function
function sub2() {
var x;
x = 10; // The value of x = 5 is replaced with x = 10
sub1();
}
Dynamic scoping : x is 10.
Using the knowledge in computational language in python it is possible to write a code that create a list of numbers 0 through 40 and assign this list to the variable numbers.
<h3>Writting the code:</h3>
<em>numbers=list(range(53));</em>
<em>print(numbers);</em>
<em>str1 = "I like nonsense, it wakes up the brain cells. Fantasy is a necessary ingredient in living."</em>
<em>numbs=sum(map(lambda x:1, str1))</em>
<em>print(numbs);</em>
<em>numbers=list(range(41));</em>
<em>sum1=sum(numbers);</em>
<em>print(sum1);</em>
See more about python at brainly.com/question/18502436
#SPJ1
Answer:
d. European nations competed and made alliances to control colonies.
Explanation:
The world War I was a period of battle between various countries from 1914 to 1918. It started formally on the 28th of July, 1914 and ended on the 11th of November, 1918.
Imperialism can be defined as a policy, ideology, or advocacy that sought to extend a country's power, dominion, authority and influence over another country through diplomacy, use of military force or colonization (direct territorial acquisition).
This ultimately implies that, imperialism is an advocacy or policy that is typically used to impose or extend a country's power, dominion, authority and influence. It simply means to seek colonies of other nations or countries.
Hence, imperialism led to WW1 because European nations competed and made alliances to control colonies.
In conclusion, there was an eagerness on the part of European Nations to gain colonial territories that were owned by other rival nations.
Answer:
d. Peking opera was a fusion of ancient and modern opera forms
Explanation:
The dramatic art form known as Beijing opera—or Peking opera—has been a staple of Chinese entertainment for more than two centuries. It was founded in 1790 when the "Four Great Anhui Troupes" went to Beijing to perform for the Imperial Court.
Some 40 years later, well-known opera troupes from Hubei joined the Anhui performers, melding their regional styles. Both the Hubei and Anhui opera troupes used two primary melodies adapted from the Shanxi musical tradition: "Xipi" and "Erhuang." From this amalgam of local styles, the new Peking or Beijing opera developed.
Reference: Szczepanski, Kallie. “A Brief History of Chinese Opera.” ThoughtCo, ThoughtCo, 6 Feb. 2019