122.255.255.255
--------------------------------
Answer:
- def getData(a_dict, key_list):
- result = []
-
- for key in key_list:
- result.append(a_dict[key])
-
- return result
-
- result = getData( {"puffin": 5, "corgi": 2, "three": 3} , ["three", "corgi"])
- print(result)
Explanation:
Let's define a function <em>getData() </em>with two parameters,<em> a_dict </em>and <em>key_list</em> as required by the question (Line 1).
Since the function is to return a list of associated values of dictionaries, a new list,<em> result</em>, is declared and initialized with empty values (Line 2).
Next, use for-loop to traverse through every string in the input <em>key_list </em>(Line 4) and use the traversed key to address the value in the<em> a_dict </em>and add it to the <em>result</em> list (Line 5)
At last, return the <em>result </em>list as output (Line 7)
We can test the function using the test case from the question and we shall see the output as follows:
[3, 2]
Answer:
x = int(input("Enter an integer: "))
y = int(input("Enter another integer: "))
if x > y:
for number in range(y+1, x):
print(number, end=" ")
elif y > x:
for number in range(x+1, y):
print(number, end=" ")
else:
print("There are no integers between {} and {}".format(x, y))
Explanation:
*The code is in Python.
Ask the user to enter the two integers, x and y
Since we want our program to run regardless of which entered value is larger, we need to compare the numbers to be able to create the loop that prints the numbers.
Check if x is greater than y. If it is, create a for loop that iterates from y+1 to x-1 and print the numbers
Otherwise, check if y is greater than x. If it is, create a for loop that iterates from x+1 to y-1 and print the numbers
If none of the previous part is executed, print that there are no integers between
Answer:
D. Misconfigurations
Explanation:
There are a large number of network security vulnerability with is a continuously increasing as technology evolves. Examples of the vulnerabilities are DOS attacks, reconnaissance attack, spyware, key logger, Malicious ware attacks etc.
There are good ways of mitigating these attacks, but sometime lack of vendor support of network devices and end of life systms, broadens the attacks.
Alyona would discuss option A - C, but not D (Misconfigurations) because it would only imply the capacity of the network team.
Answer:
The program written in python is as follows
prices = "34.62 76.30 85.05"
stock_prices = prices.split()
for price in stock_prices:
print('s', price)
Explanation:
This line initialized the input prices using a string variable named prices
prices = "34.62 76.30 85.05"
This line converts prices to list
stock_prices = prices.split()
The following iteration prints each element of the list
for price in stock_prices:
print('s', price)