Answer: All of these.
Explanation: Lets take a two-dimensional array alphabet[4][4]
Lets say this array contains the following elements: Example 1
a b c d
l i o n
f e l l
s t e m
These are the strings with same length. So this 2D array can contain strings of same length.
Now lets take another 2D array Example 2
a b c
h i n t
s o
e g g
2D array can have all these above mentioned elements. So it can contain strings of different lengths.
Now consider the Example 2. Some places for the elements are left. This isn't an issue for 2D array. So it can contain uninitialized elements too.
So the answer is All of above.
Answer:
#section 1
def maxTemp(filename):
import pathlib
f = pathlib.Path(filename)
f.exists()
if f.exists():
f = open(filename, "r")
#section 2
next(f)
res = [int(sub.split(',')[1]) for sub in f]
maxdata = (res[0])
for i in range(len(res)-1):
if maxdata < res[i]:
maxdata = res[i]
index = res.index(maxdata)
f.close()
#section 3
li = []
a = open(filename, "r")
for line in a:
line = line.strip()
li.append(line)
a.close()
return (li[index+1])
else:
return -1
print(maxTemp("new.csv"))
Explanation:
#section 1:
The function maxTemp is defined. We import pathlib in other to check if the file exists, if it does we carry on with opening the file and if it doesn't the program returns -1.
#section 2:
We start splitting the sub-lists from the second line i.e <em>next(f)</em>. For each line we take the second index element and convert it to an integer.
<em>res = [int(sub.split(',')[1]) for sub in f]
</em>
The maximum number is gotten by using the if statement to compare all elements in the list. The index of the maximum item in the list is collected.
the file is then closed.
#section 3 :
The file is re-opened and all the lines are striped and passed into a new list and the index recovered from section 2, is used to get the day with the highest temperature and the line is returned.
Answer:
look up some stories if you can like about dogs or something and then write why you like animals then write about how much you need to know about dogs or cats to be a good dog/cat owner
Explanation:
I already gave you the two stories didn't I in your last questions?
Answer:
4. A Web server has been specified.
Explanation:
End users have complained that when they click a link on your company's Website, the wrong client loads. You review the page with the suspect link and find the following HTML code:
To begin an FTP session, click the following link:
FTP Session
The problem is that Web server has been specified.
Correctness is key. The other ones are optimizations at most. Although I would always include humor... ;-)