Exam in
81 questions
We use the put method in the HTTP request message for doing partial updates.
To determine the type of an object, we can use the "typeof" function in JavaScript.
CSS can be defined externally in a separate file by adding the <style> element inside the <head>.
var colors = (1:"red", 2:"green", 3:"blue") is one of the ways of defining an array in JavaScript.
Django views represents the presentation layer of Django.
In Python, format function is used to format the datatypes of the output.
In Python, A set is a collection which is both unordered and indexed.
We can register models in the admin.py file to view it in the administration site of Django.
"Post.Objects.all()" will retrieve all objects in the Post table.
The super() function in python enables a class to have unlimited number of attributes.
"migrate" command in Django is used to show the changes happened in the database.
In Python, to append elements from another list to the current list, use the update() method.
In Python, to add items from another set into the current set, use the extend() method.
Tags and texts that are not directly displayed on the HTML page are written in title section.
If an application is running on Web Server Gateway Interface (WSGI), then it will handle client requests in a sequential manner.
For a model to be visible in the admin interface it has to be registered in the settings.py file.
In DOM, ChildNodes property returns elements and ignores text and comments.
In python, a set is a collection which is unordered and unindexed.
In python, to create a class that inherits from another class we use inherits keyword.
In Python, when using the super () function, the child class will not inherit the methods and properties from the parent class.
In the following statement: myNumbers = [1,2,3]
x = myNumbers.pop()
The removed item will be 1.
The removed item will be 3.
x = ("apple", "banana", "cherry") is a definition of a list.
my-var is an incorrect variable name in Python.
The CSS property background-attachment is used to specify whether the image is attached to the document or not.
The output of the following statements is Hello, My
b= "Hello, My Friend"
Print (b [:8])
Strip() function is used to remove whitespaces from the beginning and end of a string in Python.
The output of the following Python statements is ['a', 'b', 'C']
X=['C','b','a']
X.sort()
Print(X)
When you create a Django project on your computer, you will get a folder for your project with a specific content including templates file.
Django comes with a built-in user interface that allows you to administrate your data. To access this interface you have to create a user name and password. To create this such user, you write python mange.py createuser.
AJAX is used for refreshing the page content by sending a request to the server and updating the whole HTML page from the response.
The output of the following Python statements is ['a', 'b', 'c']
X=['C','b','A']
X.sort(key=str.lower)
<br> tag is used to force the browser to display the next text or element on a new line.
y= ("apple",) is a tuple.
An HTTP response content type denotes
Using authorization, having a response of status 200 means that
Using authorization, having a response of status 403 means that
In the following function:
function multiply(...myNumbers) {
let total = 1
for (let myNumber of myNumbers) total *= myNumber;
return total; }
The "..." will:
Which of the following is true about JavaScript syntax?
What does 'use strict' do in JavaScript?
What is the result of running the following code in strict mode?
x=10;
console.log(x);
What is the difference between var, let, and const?
What is the purpose of the prototype property in JavaScript objects?
In JavaScript, which of the following is a valid getter in an object?
What will the following JavaScript code log?
const obj = {a: 1, b: 2 };
delete obj.a;
console.log(obj)
In JavaScript, What is the purpose of the constructor method in a class?
In JavaScript, What does the super keyword do?
How many ways are there with which we can declare a variable in javascript?
What does document.querySelectorAll() return?
What does window.location.href return?
What is the purpose of window.history.back()?
How do you remove an element from the DOM?
What will be the output of "document.getElementById("id1").firstChild.nodeName;"?
By using this CSS selector p.center {color: blue;}, the number of elements that will be styled is
By using this CSS selector p:first-child { color: blue;}, how many elements will be styled?
By using this CSS selector div + p { color: red;}, how many p elements will be styled?
By using this CSS selector p:empty {color:red;}, how many elements will be styled?
If we wrote "var x=document.getElementsByTagName("p")" inside a script tag, then the length of x will be:
The value of x in this code, "x=document.body.children;" is:
If we wrote this code, "y=x[0].children" then y will contain:
If we wrote this code, "z=y[0].children; M=z[0].firstChild.nodeValue;" Then the value of M will be:
What is a correct syntax for creating a Django project?
If you have a Django application named members, and a model named Member, what is a correct syntax to import the model?
When you have done changes in a model in Django, which command has to be executed in order to make the changes take effect in the database?
In the following Python Statements:
Y={1,1,2,3,3,5}
print(Y)
The output will be:
What does {{ name }} this mean in Django Templates?
What will be the output of the following Python code?
car= {
"brand": "Ford",
"model": "Mustang",
"year": 1964
}
y= car["color"] = "red"
print(len(y))
What will be the output of the following Java Script code snippet?
function test(...args) {
document.write(typeof(args));
test(12);
Which method can be used to combine two arrays in JavaScript?
What will be the output of the following python code?
newtuple = (1,2,3,4)
(*k,) = newtuple
Print(k)
newtuple=(1,2,3)
(x, *k, y, z, m) = newtuple
Identify the error in this CSS code:
.class { color: blue; font-weight; bold; }
Why might the CSS rule .container p {color: green;} not apply to a paragraph inside a div with class "container"?
If an element has margin: 10px; and padding: 20px;, what is the space between the element and its neighboring element?
In the following Python statements:
Y=set(("a","b","c"))
Print(y)
x = { "name": "Ahmed", "id": "1", "mobile": 123456789, "mobile": 987654321 }
print(x)
The above print will return:
What is the output of the following JavaScript snippet?
var writeMe="console.log('document.writeln(x);')"
var x=13
eval(writeMe);
What will be the output of this JavaScript code?
const myArr =[1,2, [3, [4, 5, 6, 7], 8]];
const newArr = myArr.flat (2);
console.log(newArr);
Consider the following async function and its output. What will be displayed to the console when calling the f() function?
async function f() {
let promise = new Promise((resolve, reject) => {
console.log('first!');
setTimeout(() => resolve('done!'), 1000);
});
let result = await promise;
console.log(result);
f();
Question 3 - [8 Marks] 1. Display the text "My favorite subject is English Arabic" where "English" is struck-through and "Arabic" is underlined. [2marks] 2. Add a button labeled "Style" that, when clicked, changes the paragraph's: [3 marks for structure] Font color to green [1 mark], Font size to 14px [1 mark], Font family to Arial [1 mark]