**1. Identify the stylesheet relationship:** An external CSS resource is attached using a link element with rel="stylesheet". The href attribute supplies its file URL.
**2. Match the option:** B places the link in the document head and uses href="mystyle.css" with the correct rel attribute. type="text/css" is acceptable, though normally unnecessary for HTML stylesheets.
**Answer: B — The head link with rel="stylesheet" and href="mystyle.css".**
A: **Incorrect:** url does not replace the required rel="stylesheet" relationship attribute.
B: **Correct:** rel identifies the stylesheet relationship and href identifies the resource.
C: **Incorrect:** file is not the stylesheet URL attribute, and href is incorrectly set to stylesheet.
D: **Incorrect:** Neither url nor file supplies the required rel/href pairing.
**1. Select diagnostic output:** curl -v enables verbose mode, reporting connection details and the sent request and received response headers, which helps debug an HTTP exchange.
**2. Distinguish response inclusion:** curl -i includes response headers with the body but does not supply the same request-side and connection diagnostics.
**Answer: B — curl -v <URL>.**
A: **Incorrect:** -i includes response headers but is not the full verbose diagnostic option.
B: **Correct:** -v enables the requested verbose request/response diagnostics.
C: **Incorrect:** --headers is not the documented flag for this behavior; --header sets a request header.
D: **Incorrect:** -X GET selects the request method but does not enable detailed diagnostics.
Read the statements given below carefully and select the correct option.
**Statement 1**: If an element that belongs to two different classes is styled externally using both the
classes, then for the same attribute, it will acquire styling from the latest class in order.
**Statement 2**: If an element having an ID and a class is styled externally using both its ID and the
class, then for the same attribute, it will acquire styling from the ID selector.
6406533774148.
Both statements 1 and 2 are correct
6406533774149.
Both statements 1 and 2 are incorrect
6406533774150.
Statement 1 is correct but statement 2 is incorrect
6406533774151.
Statement 2 is correct but statement 1 is incorrect
Published solution
**1. Break a class-selector tie:** For otherwise equal normal declarations using simple class selectors, equal specificity means the later rule in the stylesheet wins. The order of class names in the HTML attribute does not decide the result.
**2. Compare class and ID:** A normal ID selector has higher specificity than a simple class selector, so its competing declaration wins. Under the intended equal-origin, equal-layer, non-important assumptions, both statements are correct.
**Answer: A — Both statements 1 and 2 are correct.**
**Convention note:** The question assumes matching simple selectors, equal cascade origin/layer, no !important and no overriding inline declaration. “Latest class” means the later CSS rule, not the later class token in the HTML.
A: **Correct:** Both follow the usual cascade after applying the stated comparison assumptions.
B: **Incorrect:** Neither is wrong under the intended simple-selector comparison.
C: **Incorrect:** Statement 2 is also correct under these assumptions.
D: **Incorrect:** Statement 1 is also correct when “latest” means later stylesheet source order.
**1. Read the cardinality marks:** A bar denotes one, a circle denotes optional zero, and a crow’s foot denotes many. A one-to-one relationship has a maximum of one entity at each end.
**2. Compare diagrams:** A has exactly one at both ends. B has one at one end and zero-or-one at the other; its maximum cardinality is still one-to-one. C and D contain many-end crow’s-foot marks.
**Answer: A, B — A and B — mandatory and optional variants of one-to-one.**
A: **Correct:** Both ends have exactly-one marks.
B: **Correct:** The optional end has maximum one, so optional participation does not make it one-to-many.
C: **Incorrect:** Crow’s-foot marks at both ends indicate many-to-many.
D: **Incorrect:** A crow’s-foot end permits many and rules out one-to-one.
**1. Resolve each property separately:** The inline style makes the background yellow. #container supplies dashed border style; .content supplies green border color; div supplies 3 px border width and 250 px content width.
**2. Combine the winners:** The result is a yellow box with a 3 px dashed green border and the heading “Welcome to Web Dev”. An ID rule for border-style does not overwrite an unrelated border-color from a class.
**Answer: A — Yellow background with a 3 px dashed green border.**
A: **Correct:** This combines yellow background, dashed style and green border correctly.
B: **Incorrect:** The inline yellow background prevents blue.
C: **Incorrect:** A visible border is specified and should not disappear.
D: **Incorrect:** The inline yellow background outranks the red ID background.
**1. Style the parent:** The div matches the ID rule, so its own color becomes yellow rather than the class green or type blue.
**2. Style the actual text element:** The text is inside an h3 with its own color:red declaration. A directly specified child color takes precedence over an inherited parent color, regardless of the parent selector’s specificity.
**Answer: D — RED.**
A: **Incorrect:** The div’s blue is overridden, and the h3 has a direct red declaration.
B: **Incorrect:** Yellow is the parent div’s color, but the h3 specifies its own color.
C: **Incorrect:** Green does not win on the parent and is not the h3’s direct color.
D: **Correct:** The h3 rule directly sets the text red.
**1. Apply the string test:** The template tests whether lowercase i occurs in each product name. Food fails; Electrical, Stationary and Electronics each contain i.
**2. Emit the matching entries:** The generated list contains “102, Electrical, 4, 16”, “103, Stationary, 7, 14” and “104, Electronics, 10, 145”, in original order.
**Answer: B — Entries 102 Electrical, 103 Stationary and 104 Electronics.**
A: **Incorrect:** Food lacks lowercase i, while Electrical and Electronics should also be included.
B: **Correct:** This includes exactly the three names containing lowercase i.
C: **Incorrect:** Electrical and Electronics also contain i, so Stationary is not the only match.
D: **Incorrect:** Stationary also contains i and must not be omitted.
**1. Compute the candidate means:** Kalki has total 10 and mean 2; Leo has total 12 and mean 2.4; Jailer has total 14 across five ratings, giving \(14/5=2.8\). Pushpa2 is not present.
**2. Select and describe the actual return:** python main.py Jailer selects that entry. The function returns a dictionary, so the literal printed result is {\'Jailer\': 2.8}, rather than a bare 2.8.
**Answer: D — python main.py Jailer.**
**Convention note:** The question abbreviates the output to the average. The shown function actually returns and prints a one-entry dictionary containing that average.
A: **Incorrect:** Kalki has mean 2.0.
B: **Incorrect:** Leo has mean 2.4.
C: **Incorrect:** The name is absent, so the function returns Movie not found.
D: **Correct:** Jailer is the entry whose mean is 2.8.
**1. Read the original argument list:** The command gives sys.argv[0]="mad1.py" and sys.argv[1]="mad2.py". Importing mad2 executes its top-level code without changing this process-wide list.
**2. Follow the print order:** mad2 first prints “Welcome mad1.py”. Control then returns to mad1, which prints “Welcome mad2.py”. The later command-line words do not affect either indexed read.
**Answer: C — Welcome mad1.py; Welcome mad2.py.**
A: **Incorrect:** The program reads indices 0 and 1, not the later MAD-I/MAD-II argument.
B: **Incorrect:** This reverses the import-time print and the later main-script print.
C: **Correct:** The imported module sees index 0 first, then the main script reads index 1.
D: **Incorrect:** These later argument-like names are not the values read by the code.
**1. Compute propagation times:** At \(2\times10^8\) m/s, 1000 km takes 5 ms one way and 2000 km takes 10 ms one way. A symmetric round trip over 2000 km takes 20 ms, not 50 ms.
**2. Interpret sequential throughput:** With only one outstanding request and negligible transfer/processing time, a 20 ms round trip allows \(1/0.020=50\) completed requests per second. D is correct under that intended sequential model.
**Answer: A, B, D — A, B and D under the sequential-request model.**
**Convention note:** D is not a universal server capacity bound: concurrent or pipelined requests can exceed 50 requests/s, and a 1 KB response size alone does not specify transfer time without bandwidth. The key assumes one outstanding request and negligible additional delay.
A: **Correct:** One million metres divided by the stated speed is 0.005 s.
B: **Correct:** Two million metres divided by the speed is 0.010 s.
C: **Incorrect:** The stated distance gives a 20 ms propagation round trip, not 50 ms.
D: **Correct:** A single sequential request stream is limited to 50 round trips per second if other delays are ignored.
**1. Select the qualifying gifts:** Price below 200 and rating above 4 select Coffee Mug (150,4.5) and Notebook (180,4.7). Keychain costs 100 but its rating is only 3.9.
**2. Join on the gift key:** B explicitly joins Gifts to Reviews on GiftID. D expresses the same inner join with a comma-separated FROM and matching-key WHERE condition. Each returns the required names without duplication in the supplied one-review-per-gift data.
**Answer: B, D — B and D — the explicit join and equivalent WHERE join.**
**Convention note:** For a general table allowing multiple qualifying reviews per gift or repeated gift names, SELECT DISTINCT or an EXISTS query would be needed to guarantee unique names. The listed correct queries have no duplicates for the provided rows.
A: **Incorrect:** This has no join condition, causing unrelated review matches and duplicates.
B: **Correct:** The key join and both filters return the two qualifying gifts.
C: **Incorrect:** The aliases g and r are used without being declared, so the query is invalid.
D: **Correct:** The equality condition links each review to its own gift before applying the filters.
**1. Include both travel directions:** Since each data centre responds only after receiving a request, its propagation round-trip time is \(2D_i/m_i\). DC2 completes 200 ms, or 0.2 s, later: \(2D_2/m_2=2D_1/m_1+0.2\).
**2. Solve for the unknown speed:** Multiply through and isolate the denominator: \[m_2=\frac{2D_2}{2D_1/m_1+0.2}=\frac{2D_2m_1}{2D_1+0.2m_1}.\]
**Answer: D — \(m_2=2D_2m_1/(2D_1+0.2m_1)\).**
**Convention note:** Requests are assumed to be sent simultaneously, with propagation-only timing apart from the stated difference.
A: **Incorrect:** This uses one-way timing and gives the delay the wrong sign.
B: **Incorrect:** This uses one-way rather than round-trip timing.
C: **Incorrect:** DC2 is later, so its time must be increased, not reduced.
D: **Correct:** This follows the round-trip difference with the correct positive delay.
**1. Preserve the address bit string:** Each three-digit octal group contributes nine bits. The five groups become 001100101, 001010011, 000001000, 010011101 and 100101011.
**2. Pad and regroup in hexadecimal:** Concatenate the 45 bits, pad on the left to 64 bits, then group into 16-bit blocks. The hexadecimal result is 0000:0652:9821:3B2B.
**Answer: C — 0000:0652:9821:3B2B.**
**Convention note:** These are fictional formats defined by the exercise. The text’s “4-bit hexadecimal numbers” is a typo: four groups of four hex digits are 16 bits each, totaling 64 bits.
A: **Incorrect:** This permutes the hexadecimal groups instead of preserving their order.
B: **Incorrect:** This moves padding to the low-order end and changes the numerical value.
C: **Correct:** Left-zero-padding and hexadecimal regrouping give this exact address.
D: **Incorrect:** The zero block belongs on the high-order left, not the right.
**1. Follow the nested generators:** The outer generator creates one table row for each of [1,2,3] and [4,5,6]. The inner list creates one data cell per entry of the current row.
**2. Render the structure:** The result is an HTML document titled “Title”, containing a table with two rows and three cells per row: 1,2,3 followed by 4,5,6. print outputs the generated HTML source.
**Answer: A — An HTML table with rows (1,2,3) and (4,5,6).**
A: **Correct:** This preserves the two input rows and three cells in each.
B: **Incorrect:** This incorrectly merges all six cells into one row.
C: **Incorrect:** PyHTML provides the html tag constructor used in the snippet.
D: **Incorrect:** The two-row generated-document option is valid.
**1. Follow the branch rather than its label:** sys.argv[1] is string, selecting the elif branch, which constructs T2: the Jinja Template class.
**2. Substitute only Jinja syntax:** Jinja replaces {{price}} with $20, but $title is ordinary text to Jinja and stays unchanged. The printed sentence is “The book title is $title and it costs $20.”
**Answer: B — The book title is $title and it costs $20..**
A: **Incorrect:** Jinja does not interpret the dollar placeholder $title.
B: **Correct:** Only the double-brace price expression is replaced in this branch.
C: **Incorrect:** This is the other template engine’s substitution pattern, not the chosen branch.
D: **Incorrect:** The price double-brace expression is valid and is replaced.
**MLF**
**Section Id :** 64065379123
**Section Number :** 6
**Section type :** Online
**Mandatory or Optional :** Mandatory
**Number of Questions :** 13
**Number of Questions to be attempted :** 13
**Section Marks :** 40
**Display Number Panel :** Yes
**Section Negative Marks :** 0
**Group All Questions :** No
**Enable Mark as Answered Mark for Review and**
No
**Clear Response :**
**Section Maximum Duration :** 0
**Section Minimum Duration :** 0
**Section Time In :** Minutes
**Maximum Instruction Time :** 0
Published solution
**1. Account for shell argument splitting:** The command python app.py jinja 2 gives sys.argv[1]="jinja" and sys.argv[2]="2". The first value is not the single string "jinja 2".
**2. Select the fallback:** It is also not "string", so neither conditional branch matches. The else branch prints “Invalid input”.
**Answer: D — Invalid input.**
A: **Incorrect:** No rendering branch matches the unquoted two-word argument.
B: **Incorrect:** This would require selecting the Jinja-rendering branch via the argument string.
C: **Incorrect:** Quoting "jinja 2" as one argument would select T1 and give this result, but the shown command does not quote it.
D: **Correct:** The first argument jinja matches neither tested string.