terms = ["Bandwidth", "Hierarchy", "IPv6", "Software", "Firewall", "Cybersecurity", "Lists", "Program", "Logic",
"Reliability"]
def swap(arr, in1, in2):
w = arr[in1]
arr[in1] = arr[in2]
arr[in2] = w
print(terms)
swap(terms, 5, 1)
swap(terms, 2, 4)
swap(terms, 3, 5)
swap(terms, 5, 6)
swap(terms, 6, 8)
swap(terms, 8, 9)
print(terms)
This is how I interpreted the question. If I need to make any changes, I'll do my best. Hope this helps though.
Answer:
5
Explanation:
I did it to and it was right
Answer:
def select_short_strings(string_list):
new_list = []
for s in string_list:
if len(s) < 20:
new_list.append(s)
return new_list
lst = ["apple", "I am learning Python and it is fun!", "I love programming, it is easy", "orange"]
print(select_short_strings(lst))
Explanation:
- Create a function called <em>select_short_strings</em> that takes one argument <em>string_list</em>
Inside the function:
- Initialize an empty list to hold the strings that are less than 20
- Inside the loop, check the strings inside <em>string_list</em> has a length that is smaller than 20. If found one, put it to the <em>new_list</em>.
- When the loop is done, return the <em>new_list</em>
- Create a list to check and call the function
I am not too familiar with the Python language, but the algorithm would be something like this:
1. create a variable for the sums of the number
2. read in how many numbers the user wants to enter (let's call it N)
and then create a for loop:
for N times
read in the next number
increase the sum variable by that number
Hopefully this helps!
The action that an operating system performs is that it facilitates a computer's basic functions between hardware and software.
<h3>What is the purpose of an operating system in a computer?</h3>
An operating system (OS) is known to be a term that is used in computing and it is said to be one which the program, after being started is said to be loaded into the computer using the boot program.
It is one that helps to handle all of the other application programs in a computer.
The application programs is known to also make use of the operating system and as such, The action that an operating system performs is that it facilitates a computer's basic functions between hardware and software.
Learn more about operating system from
brainly.com/question/22811693
#SPJ1