I would need more to answer your question
Answer:
Change:
print("Season is",season)
To:
print("Season is " + season)
Explanation:
String Concatenation can be done using many ways but not by comma. You can use the + operator like i just did or % operator, join method or format function.
But for now, try using the + operator.
Answer:
employees.get(0)
Explanation:
In the programming, the index of ArrayList start from zero.
So, the element start storing in the ArrayList from the zero index.
get() is the function which is used to retrieve or getting the value in the
ArrayList.
The function employees.get(0), it retrieve the element of zero index.
The function employees.get(1), it retrieve the element of first index.
The function employees.first(1), it is wrong calling.
The function employees.get(), it is wrong calling. you have to enter the index value inside the get().
Answer: Hello your required question is wrong as it does not tally with the data provided , attached below is the complete question
answer:
/23 /26 /27 /28 option A
Explanation:
<u>Breakdown of the last four subnet masks given to the subnets </u>
For the subnet of 500 production host the mask = /23 which will produce 512 hosts
For the subnet of 60 sales host the mask = /26 which will produce 64 hosts
For the subnet of 12 host the mask = /27 which will produce 32 hosts
For the subnet of 30 hosts the mask = /28 which will produce 16 hosts
In python 3.8:
def func(value_list):
lst = [x for x in value_list if type(x) == int or type(x) == float]
return sum(lst)
print(func(["h", "w", 32, 342.23, 'j']))
This is one solution using list comprehensions. I prefer this route because the code is concise.
def func(value_list):
total = 0
for x in value_list:
if type(x) == int or type(x) == float:
total += x
return total
print(func(["h", "w", 32, 342.23, 'j']))
This is the way as described in your problem.