1. C
2. B
3. C
4. A
5. A
6. B
7. C
8. D
9. C
10. B
11. D
12. D
13. D
14. A
15. A
16. B
17. A
18. B
19. D
20. B
Some of the ones towards the start may not be right but I gave it a go :)
Which is a multicast address ?
ans: 241.2.2.1
num1 = float(input("Enter the first number: "))
num2 = float(input("Enter the second number: "))
operation = input("Which operation are you performing? (a/s/m/d) ")
if operation == "a":
print("{} + {} = {}".format(num1, num2, num1+num2))
elif operation == "s":
print("{} - {} = {}".format(num1, num2, num1-num2))
elif operation == "m":
print("{} * {} = {}".format(num1, num2, num1*num2))
elif operation == "d":
print("{} / {} = {}".format(num1, num2, num1/num2))
I hope this helps!
Answer:
Explanation:
The following Python program uses a combination of dictionary, list, regex, and loops to accomplish what was requested. The function takes a file name as input, reads the file, and saves the individual words in a list. Then it loops through the list, adding each word into a dictionary with the number of times it appears. If the word is already in the dictionary it adds 1 to its count value. The program was tested with a file named great_expectations.txt and the output can be seen below.
import re
def wordCount(fileName):
file = open(fileName, 'r')
wordList = file.read().lower()
wordList = re.split('\s', wordList)
wordDict = {}
for word in wordList:
if word in wordDict:
wordDict[word] = wordDict.get(word) + 1
else:
wordDict[word] = 1
print(wordDict)
wordCount('great_expectations.txt')
Answer:
3 bits
Explanation:
Given a 4- way set associative cache that has 64 blocks of 16 words.
Therefore, the number of sets cache has:
Now,
Cache data size is 16kB
The number of cache blocks can be calculated as:
Now,
Total sets =
Total sets =
Now,
n = 6
For 15 bit address for the architecture, the bits in tag field is given by:
15 - (6 + 6) = 3 bits
Thus the tag field will have 3 bits