Font size
Worksheets26031990
Total questions: 60
Worksheet time: 3600secs
What is the output of the given code?
10 20 10 20
10 20 10
10 20 20
Error
___________ are the arguments passed to a function in correct positional order.
Keyword arguments
Default arguments
Variable-length arguments
Required arguments
none of the above
Which of the following is true
The code above will result in syntax error
square(2,2) will result in a value of 4
square(2,3) will result in a value of 9
Which of the given argument types can be skipped from a function call?
Positional arguments
keyword arguments
named arguments
default arguments
What is the result of following Program in python3
a=4
b=2
c=a-b*6
print("\n a={0} \n b={1} \n c={2}".format(a,b,c))
12
-8
8
-12
The program above prints the sum of all the numbers between 0 and 101 that are
alternate odd numbers
alternate even numbers
alternate numbers
What is the output of the program above
10
15
18
17
16
285
200
300
250
What does the term "version control" refer to in software development?
the practice of controlling the speed at which software updates are released
to the process of naming different versions of software after different animals
the management of changes to documents, computer programs, large web sites, and other collections of information.
to the act of controlling the visual appearance of software interfaces
Which programming language is often used for building dynamic web applications?
HTML
Python
JavaScript
Java
What is the output of the attached python code?
Value error
Finally done
Type error
Finally done
Type error
Value error
Finally done
What is the output of the attached python code?
Function name error
Sum finally
Function name error
Sum finally
Function name error
Sum finally
Invocation finally
Invocation name error
Invocation finally
Sum finally
Invocation name error
Invocation finally
Function name error
Sum finally
__________ refers to the act of representing essential details.
Polymorphism
Abstraction
Inheritance
Encapsulation
What will be the output of the following code snippet?
Runtime Error
Hello World how are you today
[‘Hello’, ‘World’, ‘how’, ‘are’, ‘you’, ‘today’]
Hello
What will be the output of the following code snippet?
Runtime Error
[‘This is 1st line\n’, ‘ This is 2nd line\n’, ‘This is 3rd line’]
[‘ This is 2nd line\n’, ‘This is 3rd line’]
[ ]
What is it called where child object gets killed if parent object is killed?
Aggregation
Composition
Encapsulation
Association
What will be the output of the following Python code?
l1=[2,4,6]
l2=[-2,-4,-6]
for i in zip(l1, l2):
print(i)
2, -2
4, -4
6, -6
[(2, -2), (4, -4), (6, -6)]
(2, -2)
(4, -4)
(6, -6)
[-4, -16, -36]
a= 63
a<<2
what is output for bit-wise left-shift
230
243
250
252
What will be the output of the following code snippet?
print(2**3 + (5 + 6)**(1 + 1))
129
8
121
None of the above
Error, the syntax of the invoking method is wrong
The program runs fine but nothing is printed
1 0
1 2
Old
New
error
Nothing is printed
Error as age isn’t defined
True
False
7
s = "APCSP2018"
idx = 1
while idx < len(s):
print(s[idx])
idx = idx + 2
You are in the car with traffic jammed at a junction. To cross that junction according to the traffic rules, which one is NOT applicable
While loop
Conditional Statement
For loop
What is the purpose of if statements in Python?
To repeat a block of code a certain number of times.
To define a function in Python.
To perform different actions based on different conditions.
To sort a list of elements in ascending order.
Describe the process taking place in lines 10-13.
A conditional loop is used to keep a running total of how many goals the player scores in each of the games they've played.
A fixed loop is used to keep a running total of how many goals the player scores in each of the games they've played.
A fixed loop is used to keep a running average of how many goals the player scores in each of the games they've played.
A conditional loop is used to keep a running average of how many goals the player scores in each of the games they've played.
Examine the following code. Which line will raise an error in the context of a number-guessing game where number is 15 and guess is 'fifteen'?
Within the try block
Within the print("Correct!") line
Within the except block
No error
What is the output of the program
4
2
5
0
REST API services use for communication only HTTP protocol
True
False
Correct the error if any
mycursor = mydb.cursor()
mycursor.execute("CREATE TABLE customers (name VARCHAR(25), 'address' VARCHAR(55))")
mycursor.execute('CREATE TABLE customers (name VARCHAR(25), 'address' VARCHAR(55))')
mycursor.execute("CREATE TABLE customers (name VARCHAR(25), address VARCHAR(55))')
mycursor.execute("CREATE TABLE customers (name VARCHAR(25), address VARCHAR(55));")
mycursor.execute("CREATE TABLE customers (name VARCHAR(25), address VARCHAR55))")
What does the function re.search do?
matches a pattern at the start of the string
matches a pattern at the end of the string
matches a pattern at any position in the string
None
What will be the output of the following Python function, assuming that the random module has already been imported?
random.uniform(3,4)
error
either 3 or 4
Any integer other than 3 and 4
Any decimal value between 3 and 4
What will be the output of the following Python function (random module has already been imported)?
random.choice('sun')
sun
u
either s,u or n
error
Which format specifier used in datetime module to generate the weekday in short format?
%w
%d
%a
none
What is the purpose of generating random test data in Python?
To make the code more complicated
To slow down the code execution
To make the code easier to debug
To test the functionality and performance of the code under various scenarios.
Switch stores ___ address.
MAC address
IP address
PORT address
EMAIL address
In which topology data packet must have to pass through each nodes in the path.
Mesh Topology
Bus Topology
Ring Topology
Star Topology
Choose among the following which is a bit-oriented protocol.
SSL
HDLC
HTTP
All of the above
Who keeps the private key in asymmetric key cryptography?
Sender
Receiver
Both Sender and Receiver
None
Which Protocol Data Unit (PDU) is used at the network layer?
Segment
Packet
Frame
Bits
Which protocol is used to send packets
IP
FTP
SMTP
TCP
Which of these is NOT part of TCP's role?
Sets the rules for how devices connect on a network
Makes sure data is correctly send and delivered
To direct packets between routers
Splits data into packets
Encryption and decryption does not occur at___
Router
Switches
Source Host
Destination Host
What are two reasons you should use IPsec between two computers
data integrity and redundancy
data redundancy and confidentiality
data integrity and confidentiality
data redundancy and compression
Which Load Balancer operates at the transport layer (Layer 4) of the OSI model and can make routing decisions based on IP address and port numbers?
SSL Proxy LB
TCP Proxy LB
Network Load Balancer
Internal Load Balancer
What is the main purpose of an Identity Aware Proxy (IAP)?
To encrypt network traffic.
To distribute incoming traffic.
To manage user access to web applications.
To route traffic based on IP addresses.
What is a network load balancer?
A network load balancer is a type of load balancer that is designed to route network traffic.
A network load balancer is a type of load balancer that is designed to route HTTP and HTTPS traffic.
A network load balancer is a type of load balancer that is designed to terminate SSL connections.
A network load balancer is a type of load balancer that is designed to provide better security for traffic.
Looks for specific network patterns generate by known malware.
Signature based
Host intrusion detection system (HIDS)
Anomaly based
Security functionality
Proactive monitoring of unwanted intruders e.g. firewall.
Intrusion prevention system
Fuzzing
Signature based
Network intrusion detection system (NIDS)
Firewalls, antivirus and anti spyware installed on every machine that monitors all incoming and outgoing traffic for suspicious activities
Host intrusion detection system (HIDS)
Distributed intrusion detection system (DIDS)
Intrusion detection system (IDS)
Network intrusion detection system (NIDS)
Which of the following is NOT an IDS (Intrusion Detection System) characteristics?
IDS can overlook system errors
Survives with system crash and must be fault tolerant
Runs constantly without human supervision
Adaptability of system with technologies
