WorksheetsCyber Quiz Round 2
Total questions: 20
Worksheet time: 10mins
Which of the following elements is used to define the document's metadata in HTML?
<meta>
<head>
<link>
<title>
In HTML, which attribute is used to specify that an input field must be filled out before submitting the form?
required
validate
must
mandatory
Which HTML attribute is used to define the URL of a linked resource, such as a stylesheet?
src
href
link
rel
How can you make a comment in HTML that spans multiple lines?
<!- This is a comment ->
<!-- This is a comment
that spans multiple lines -->
/* This is a comment */
// This is a comment
Which of the following is correct for embedding a responsive YouTube video using HTML5?
<iframe src="https://www.youtube.com/embed/videoID" width="560" height="315" allowfullscreen></iframe>
<video src="https://www.youtube.com/embed/videoID" controls></video>
<iframe src="https://www.youtube.com/videoID" allowfullscreen></iframe>
<object data="https://www.youtube.com/embed/videoID" width="560" height="315"></object>
How can you include a JavaScript file in an HTML document?
<script src="file.js"></script>
<script href="file.js"></script>
<js src="file.js"></js>
<link rel="script" href="file.js">
What is the CSS property used to create space between the content of an element and its border?
margin
padding
border-spacing
spacing
Which of the following CSS properties is used to control the stacking order of elements that overlap?
stack
z-order
order
How would you apply a linear gradient background from top to bottom using CSS?
background: linear-gradient(to top, #000, #fff);
background: linear-gradient(to bottom, #000, #fff);
background: gradient(linear, top, #000, #fff);
background: linear-gradient(vertical, #000, #fff);
What is the difference between display: inline and display: inline-block in CSS?
inline elements do not respect width and height, inline-block elements do
inline elements respect width and height, inline-block elements do not
inline-block elements take up the full width of their container, inline elements do not
There is no difference
Which of the following is the most appropriate method for applying a style to all
.content div { /* styles */ }
.content > div { /* styles */ }
div .content { /* styles */ }
div:content { /* styles */ }
How can you ensure that an element's box-shadow only appears on the top side using CSS?
box-shadow: 0px -5px 5px #888;
box-shadow: 0px 0px 5px #888;
box-shadow: 5px 5px 0px #888;
box-shadow: -5px 0px 5px #888;
What is the purpose of the :nth-child(n) selector in CSS?
It selects all child elements of the nth parent
It selects every nth child element within a parent
It selects the nth element of a certain type within a parent
It selects the first n child elements within a parent
What will be the output of the given code?
34
28
25
16
Which of the following is the correct way to create a Python dictionary?
d = {"one": 1, "two": 2}
d = ["one": 1, "two": 2]
d = ("one": 1, "two": 2)
d = {"one", 1, "two", 2}
What will be the output of the given code snippet?
5
6
7
Error in Code
Which of the following will result in an error?
print("Hello, World!")
print("Hello" + 2)
print("Hello" + "World")
print(2 + 3)
What does the continue statement do in Python?
It ends the loop immediately and proceeds with the next statement after the loop
It skips the remaining part of the current iteration and moves to the next iteration
It restarts the loop from the beginning
It moves to the next function call
What will the following code output?
10
2
0
-2
