Respuesta :
Answer:
vocab = [ "Libraries", "Bandwidth", "Hierarchy", "Software", "Firewall", "Cybersecurity","Phishing", "Logic", "Productivity"]
print(vocab)
needNextPass = True
k = 1
#list = [x.lower() for x in list]
while k < len(vocab)-1 and needNextPass:
# List may be sorted and next pass not needed
needNextPass = False
for i in range(len(vocab) - k):
if vocab[i] > vocab[i + 1]:
# swap list[i] with list[i + 1]
temp = vocab[i]
vocab[i] = vocab[i + 1]
vocab[i + 1] = temp
needNextPass = True # Next pass still needed
print(vocab)
Explanation:
I hope this helps you!
Answer:
vocab = ["Libraries", "Bandwidth", "Hierarchy", "Software", "Firewall", "Cybersecurity","Phishing", "Logic", "Productivity"]
print(vocab)
needNextPass=True
k=1
while (k < len(vocab)-1 and needNextPass):
needNextPass=False
for i in range(len(vocab)-k):
if vocab[i] > vocab[i+1]:
temp=vocab[i]
vocab[i]=vocab[i+1]
vocab[i+1]=temp
needNextPass=True
print(vocab)
Explanation:
I got a 100%