Answer:
See explaination
Explanation:
Cache can be referred to as a hardware or software component that stores data so that future requests for that data can be served faster; these stored data in a cache might be the result of an earlier computation or a copy of data stored elsewhere.
Please kindly check attachment for step by step solution.
Answer:
See explaination
Explanation:
Definition of Class 1:
class Stat:
def __init__(self, li):
self.li = li
def add(self, value):
self.li.append(value)
def __len__(self):
return len(self.li)
def min(self):
try:
return min(self.li)
except:
return "EmptyStatError: empty Stat does not have a min"
def max(self):
try:
return max(self.li)
except:
return "EmptyStatError: empty Stat does not have a max"
def sum(self):
return sum(self.li)
def mean(self):
try:
return float(sum(self.li))/float(len(self.li))
except:
return "EmptyStatError: empty Stat does not have a mean"
def __getitem__(self):
return self.li
def clear(self):
del self.li[:]
Definition of Class 2:
class intlist:
def __init__(self, li):
self.li = li
def append(self, value):
if type(value) == int:
self.li.append(value)
else:
print "NotIntError: Input is not an Integer."
def insert(self, index,value):
if type(value) == int:
self.li.insert(index, value)
else:
print "NotIntError: Input is not an Integer."
def extend(self, value):
i = 0
for temp in value:
if type(temp) == int:
i = i
else:
i = i+1
if i==0:
self.li.extend(value)
else:
print "NotIntError: Input is not an Integer."
def __setitem__(self, index, value):
self.insert(index, value)
def __getitem__(self, index):
return self.li[index]
def odds(self):
lis = []
for temp in self.li:
if temp%2 == 1:
lis.append(temp)
return lis
def evens(self):
lis = []
for temp in self.li:
if temp%2 == 0:
lis.append(temp)
return lis
Class 1 call:
s = Stat([])
s.add(2.5)
s.add(4.7)
s.add(78.2)
print len(s)
print s.min()
print s.max()
print s.sum()
print s.mean()
print s.li
s.clear()
print s.li
print len(s)
print s.min()
print s.max()
print s.mean()
print s.sum()
Class 2 call:
intl = intlist([])
print intl.li
intl = intlist([1,2,3])
print intl.li
intl.append(5)
print intl.li
intl.insert(1,99)
print intl.li
intl.extend([22,44,66])
print intl.li
print intl.odds()
print intl.evens()
print intl.li
intl[2] = -12
print intl[4]
Answer:
67%
Explanation:
TCP Header = 20 bytes
IP Header = 20 bytes.
Data chunk = 20 bytes
Adding the 20 byte data chunk to the TCP/IP header makes 60 total bytes.
Total = 60 bytes
Overhead is 40 of the 60
i.e (40/60) * 100 = 66.67 %
It stands for Electronic Business, a typical example of this is a online store.
Answer:
- Used to include additional information in an element
- May be required for certain elements
- Consist of a keyword followed by an equals sign and additional information in quotes
Explanation:
<a href="website link goes here"> <---- example element with an attribute.
- You can see the <a> element which creates a link requires a "href" (which means "Hypertext Reference", basically a fancy way of saying a link to another page) attribute for the source of the link.
- The keyword "href" is followed by an equals and wrapped in quotes.
- Can be used to include additional information, like how you can use the keyword "alt" with an <img> tag to add text that shows up when you hover over it.
----------------------------------------------------------------------------------------------------------
In response to the other answers:
- The attribute itself is not wrapped in angle brackets, though it does sit within them. It is the *element* that is wrapped in angle brackets.
- The attributes are not added to the end (closing) tag, they are added to the opening tag.