Answer:
False
Explanation:
Technology enhances the smooth run of businesses around the world at large. take an example of your transport systems, communication systems and even to advertisment of company products/services
Answer:
program :
def separate_int_and_str(list_1):# function to seprate the list.
str_list=[] #list to hold the
int_list=[]#list which holds the integer value.
for x in list_1: #for loop to extract the list.
if(type(x)==str): #if condition to check the type of the element.
str_list.append(x)#create a list for the string value.
elif(type(x)==int): #check condition for th einteger value.
int_list.append(x)#create a list for the integer value.
Explanation:
- The above-defined function is written in the python language, which used the code to separate the list for integer and the string value.
- There are two lists define in the function which holds the integer and the string value separately.
- There is a 'for' loop which scans the element of the list and checks the list by the help of type function which tells the class of the element.
- Then if the type function states that the element is from the strong class, it will assign the element on the string list otherwise it assigns the element in the integer list.
You just need to set a reminder on your phone and try and remember
For most usb devices, power is supplied via the port.
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]