Answer:
Insert
'try:' at line 1
'except:' at line 3
Explanation:
The "try and except" commands in Python are used for exception handling.
try: the statements under this block are executed normally
except: the the statements under this block are executed when there is an exception.
We can use these commands to handle errors, for example, in the given scenario we don't want the user to enter a floating point number such as
1.5, 2.6 etc.
When the user enters an integer number then the except command is not executed.
When the user enters a floating point number then the except command is executed, program is stopped and error message is shown that is at line 4
Python code:
# line 1
try:
# line 2
age = int(input("Enter your age: "))
# line 3
except:
# line 4
print("Invalid input")
Output:
Test 1:
Enter your age: 20
Test 2:
Enter your age: 20.5
Invalid input
Answer:
B) 2.22
Explanation:
In a first step, the system will look in cache number 1. If it is not found in cache number 1, then the system will look in cache number 2. Finally (if not in cache 2 also) the system will look in main memory.
The average access time will take into consideration success in cache 1, failure in cache number 1 but success in cache number 2, failure in cache number 1 and 2 but success in main memory.
Mathematically we can write it into the following equation :

Where AAT is the average access time
H1,H2 and Hm are the hit rate of cache 1,cache 2 and main memory respectively.
T1,T2 and Tm are the access time of cache 1, cache 2 and main memory respectively
Hm = 1


Therefore, option b) is the correct.
Hi there!
1. C) Ancient Structure
2. A) Iterate
3. A) NYC
The first two, I’m sure the third i’m not.
Sorry if I’m wrong and hope this helps !