Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Cyber Quiz Round 2

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

Which of the following elements is used to define the document's metadata in HTML?

a)

<meta>

b)

<head>

c)

<link>

d)

<title>

2.

What is the correct HTML5 element for embedding audio files?

a)

<audio src="audio.mp3">

b)

<audio controls>

c)

<sound>

d)

<audio file="audio.mp3">

3.

In HTML, which attribute is used to specify that an input field must be filled out before submitting the form?

a)

required

b)

validate

c)

must

d)

mandatory

4.

Which HTML attribute is used to define the URL of a linked resource, such as a stylesheet?

a)

src

b)

href

c)

link

d)

rel

5.

How can you make a comment in HTML that spans multiple lines?

a)

<!- This is a comment ->

b)

<!-- This is a comment

            that spans multiple lines -->

c)

/* This is a comment */

d)

// This is a comment

6.

Which of the following is correct for embedding a responsive YouTube video using HTML5?

a)

<iframe src="https://www.youtube.com/embed/videoID" width="560" height="315" allowfullscreen></iframe>

b)

<video src="https://www.youtube.com/embed/videoID" controls></video>

c)

<iframe src="https://www.youtube.com/videoID" allowfullscreen></iframe>

d)

<object data="https://www.youtube.com/embed/videoID" width="560" height="315"></object>

7.

How can you include a JavaScript file in an HTML document?

a)

<script src="file.js"></script>

b)

<script href="file.js"></script>

c)

<js src="file.js"></js>

d)

<link rel="script" href="file.js">

8.

What is the CSS property used to create space between the content of an element and its border?

a)

margin

b)

padding

c)

border-spacing

d)

spacing

9.

Which of the following CSS properties is used to control the stacking order of elements that overlap?

a)
z-index
b)

stack

c)

z-order

d)

order

10.

How would you apply a linear gradient background from top to bottom using CSS?

a)

background: linear-gradient(to top, #000, #fff);

b)

background: linear-gradient(to bottom, #000, #fff);

c)

background: gradient(linear, top, #000, #fff);

d)

background: linear-gradient(vertical, #000, #fff);

11.

What is the difference between display: inline and display: inline-block in CSS?

a)

inline elements do not respect width and height, inline-block elements do

b)

inline elements respect width and height, inline-block elements do not

c)

inline-block elements take up the full width of their container, inline elements do not

d)

There is no difference

12.

Which of the following is the most appropriate method for applying a style to all

elements inside a container with the class .content?

a)

.content div { /* styles */ }

b)

.content > div { /* styles */ }

c)

div .content { /* styles */ }

d)

div:content { /* styles */ }

13.

How can you ensure that an element's box-shadow only appears on the top side using CSS?

a)

box-shadow: 0px -5px 5px #888;

b)

box-shadow: 0px 0px 5px #888;

c)

box-shadow: 5px 5px 0px #888;

d)

box-shadow: -5px 0px 5px #888;

14.

What is the purpose of the :nth-child(n) selector in CSS?

a)

It selects all child elements of the nth parent

b)

It selects every nth child element within a parent

c)

It selects the nth element of a certain type within a parent

d)

It selects the first n child elements within a parent

15.

What will be the output of the given code?

a)

34

b)

28

c)

25

d)

16

16.

Which of the following is the correct way to create a Python dictionary?

a)

d = {"one": 1, "two": 2}

b)

d = ["one": 1, "two": 2]

c)

d = ("one": 1, "two": 2)

d)

d = {"one", 1, "two", 2}

17.

What will be the output of the given code snippet?

a)

5

b)

6

c)

7

d)

Error in Code

18.

Which of the following will result in an error?

a)

print("Hello, World!")

b)

print("Hello" + 2)

c)

print("Hello" + "World")

d)

print(2 + 3)

19.

What does the continue statement do in Python?

a)

It ends the loop immediately and proceeds with the next statement after the loop

b)

It skips the remaining part of the current iteration and moves to the next iteration

c)

It restarts the loop from the beginning

d)

It moves to the next function call

20.

What will the following code output?

a)

10

b)

2

c)

0

d)

-2