Answer:
Check the explanation
Explanation:
#source code:
import sys
def is_balanced(input_string):
stack = []
for i in input_string:
if(i=="{"):
stack.append("{")
elif(i=="}"):
stack.pop()
if(len(stack)==0):
return True
else:
return False
if __name__ == '__main__':
try:
_input_string = sys.argv[1]
balanced = is_balanced(_input_string)
if balanced:
print("The string {} is balanced".format(_input_string))
else:
print("The string {} is not balanced".format(_input_string))
except:
print("String can't be empty")
Kindly check the attached image below to see the code screenshot and code output.
Answer:
When a follower has offended an external party and when a leader has offended another.
Explanation:
When we have those situations above, there would not necessarily be an apology because the offence is between people in the same level of hierarchy and between people who most likely don't share the same goal or vision so this in turn will not deter or slow down their success rate.
Answer and Explanation:
at the point when information is sent starting with one piece of the system then onto the next, the information is broken into square of bits (bundles) that contain enough data so every parcel can be rerouted if essential. excess is something to be thankful for, on the off chance that a few switches come up short since then parcels will be rerouted and still effectively send.
The key to this algorithm is to compare each value with its previous value. If the previous value is larger than the current value, change currentVal= previous value and previousVal = currentVal (of course u will need a tempVal to store one of the value). The program should loop from first value til the very end and should only run once.