Font size
WorksheetsUAS - Pengantar Literasi Digital
Total questions: 40
Worksheet time: 17mins
What is the main purpose of using Python programming language?
The primary purpose of Python is to create mobile applications.
Python is known for its simplicity, readability, and versatility across various domains such as web development, data analysis, artificial intelligence, and scientific computing.
Python is primarily used for networking purposes.
Python is mainly used for gaming development.
Explain the difference between a list and a tuple in Python.
Lists are mutable, tuples are immutable.
Lists are immutable, tuples are mutable.
Lists and tuples are the same in Python.
Tuples can hold more elements than lists in Python.
Differentiate between GET and POST methods in HTML forms.
GET method is not secure as data is visible in the URL, while POST method is more secure as data is not visible in the URL.
POST method is visible in the URL
POST method is less secure than GET method
GET method is used for updating data
Write a PHP script to insert data into a MySQL database.
The connection to the MySQL database should be established using PDO instead of mysqli.
Here is a basic example:
connect_error) {
die('Connection failed: ' . $conn->connect_error);
}
// SQL query to insert data
$sql = 'INSERT INTO table_name (column1, column2, column3) VALUES (value1, value2, value3)';
if ($conn->query($sql) === TRUE) {
echo 'New record created successfully';
} else {
echo 'Error: ' . $sql . '
' . $conn->error;
}
$conn->close();
?>
The SQL query should be enclosed in double quotes instead of single quotes.
The error message should be displayed using `echo` instead of `die`.
What does SQL stands for?
Structured Query Language
Structured Question Language
Strong Question Language
None of the above
SQL is not case sensitive. Is this statement TRUE or FALSE?
TRUE
FALSE
The SQL statement that queries or reads data from a table is __________ .
USE
SELECT
READ
QUERY
The SQL statement that is used to modify data in a table.
UPDATE
SELECT
READ
QUERY
Full form of DML is ______ .
Data Modification language
Data Manipulation Language
Database Manipulation Language
Database Modification Language
Which SQL statement is used to insert new data in a database?
Insert New
Insert Into
Add Record
Add Data
With SQL, how do you select a column named "FirstName" from a table named "Person"?
SELECT FirstName FROM Person
SELECT Person.FirstName
EXTRACT FirstName FROM Person
SELECT FROM Person.FirstName
With SQL, how do you select all the columns from a table named "Persons"?
SELECT [all] FROM Persons
SELECT Persons
SELECT * FROM Persons
SELECT * all.Persons
Hypertext Markup Language, a language used to create web pages
Website Content
Website Structure
Heading
HTML
Which code defines a paragraph
<!DOCTYPE html>
<html>
<p>
<head>
What is the purpose of the PHP function 'echo'?
To perform mathematical operations
To handle exceptions
To define a constant
To display output
What is the main purpose of HTML?
To generate random numbers
To play audio files
To give text structure and meaning
To create animations
What is the file extension for a PHP file?
.css
.php
.html
.js
Which stores whole numbers without decimals, such as 123 or -123?
double
string
int
char
Which stores floating-point numbers, with decimals, such as 19.99 or -19.99?
double
int
char
string
Which stores text values surrounded by double quotes?
double
char
string
int
Why was Python (TM) developed?
To go back to the old way of programming
To create a programming language for students in grade school
To make it easier to learn Java
Python was developed by accident
Python (TM) is owned and managed by
Microsoft (c)
Sun Microsystems (c)
Python (TM) is open source and free to use
Google (c)
Python is ___________ level programming language and is ___________.
High, compiled
High, interpreted
Low, compiled
Low, interpreted
Generally speaking, a low level programming language is easier to read, write and maintain over a high level programming language
True
False
The syntax in Python (TM) is one of the main advantages over other high level programming languages.
True
False
A string
carries out an action
the elements of a command
a collection of characters
how elements in a commad are arranged
What symbol comes before a comment?
$
>>
#
!
A disadvantage of Python is it is harder to debug than other higher level programming languages.
True
False
In programming, a (n) _______________ is a value that can change, depending on conditions or on information passed to the program
string
block
instruction
variable
Since Python (TM) is open source,
Support for using Python (TM) is easy to find
It is free
There is a large catalog of supporting documents
it is a less powerful programming languange
What is the output of the expression?
round(4.5676,2)?
4.5
4.6
4.57
4.56
What is the output?
d = {"john":40, "peter":45}
d["john"]
40
45
“john”
“peter”
The results of the program below are ...
jumlah =[1,2,3,4,5,6,7,8,9]
print(jumlah[-5])
6
5
7
2
The output from the script below is ...
def abc (world):
print ('hello% s'% world) abc ('Python')
Hello world
Hello Python
All answers are missing due to an error
Hello python world
Which of the following items are present in the function header?
function name
function name and parameter list
parameter list
return value
Which of the following keywords marks the beginning of the function block?
fun
define
def
function
What are the two main types of functions?
Custom function
Built-in function & User defined function
User function
System function
What will be the output of the following Python code?
def cube(x):
return x * x * x
x = cube(3)
print (x)
9
3
27
30
Which of the following can add a row to a table?
Add
Insert
Update
Alter
Which of the following is not a keyword of MYSQL?
Select
Top
Group
Insert
