wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

26031990

Total questions: 60

Worksheet time: 3600secs

Name
Class
Date
1.

What is the output of the given code?

a)

10 20 10 20

b)

10 20 10

c)

10 20 20

d)

Error

2.

___________ are the arguments passed to a function in correct positional order.

a)

Keyword arguments

b)

Default arguments

c)

Variable-length arguments

d)

Required arguments

e)

none of the above

3.

Which of the following is true

a)

The code above will result in syntax error

b)

square(2,2) will result in a value of 4

c)

square(2,3) will result in a value of 9

4.

Which of the given argument types can be skipped from a function call?

a)

Positional arguments

b)

keyword arguments

c)

named arguments

d)

default arguments

5.

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))

a)

12

b)

-8

c)

8

d)

-12

6.

The program above prints the sum of all the numbers between 0 and 101 that are

a)

alternate odd numbers

b)

alternate even numbers

c)

alternate numbers

7.

What is the output of the program above

a)

10

b)

15

c)

18

d)

17

e)

16

8.
The condition for a while loop to continue could include which of the following?
a)
While something equals something
b)
While something is greater than something
c)
While something is True
d)
All of these
9.
What will be the output of the following code:
a)

285

b)

200

c)

300

d)

250

10.

What does the term "version control" refer to in software development?

a)

the practice of controlling the speed at which software updates are released

b)

to the process of naming different versions of software after different animals

c)

the management of changes to documents, computer programs, large web sites, and other collections of information.

d)

to the act of controlling the visual appearance of software interfaces

11.

Which programming language is often used for building dynamic web applications?

a)

HTML

b)

Python

c)

JavaScript

d)

Java

12.

What is the output of the attached python code?

a)

Value error

Finally done

b)

Type error

Finally done

c)

Type error

d)

Value error

e)

Finally done

13.

What is the output of the attached python code?

a)

Function name error

Sum finally


Function name error

Sum finally

b)

Function name error

Sum finally

Invocation finally

c)

Invocation name error

Invocation finally

d)

Sum finally

Invocation name error

Invocation finally

e)

Function name error

Sum finally

14.

__________ refers to the act of representing essential details.

a)

Polymorphism

b)

Abstraction

c)

Inheritance

d)

Encapsulation

15.

What will be the output of the following code snippet?

a)

Runtime Error

b)

Hello World how are you today

c)

[‘Hello’, ‘World’, ‘how’, ‘are’, ‘you’, ‘today’]

d)

Hello

16.

What will be the output of the following code snippet?

a)

Runtime Error

b)

[‘This is 1st line\n’, ‘ This is 2nd line\n’, ‘This is 3rd line’]

c)

[‘ This is 2nd line\n’, ‘This is 3rd line’]

d)

[ ]

17.

What is it called where child object gets killed if parent object is killed?

a)

Aggregation

b)

Composition

c)

Encapsulation

d)

Association

18.

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)

a)

2, -2

4, -4

6, -6

b)

[(2, -2), (4, -4), (6, -6)]

c)

(2, -2)

(4, -4)

(6, -6)

d)

[-4, -16, -36]

19.

a= 63

a<<2

what is output for bit-wise left-shift

a)

230

b)

243

c)

250

d)

252

20.

What will be the output of the following code snippet?

print(2**3 + (5 + 6)**(1 + 1))

a)

129

b)

8

c)

121

d)

None of the above

21.
a)

Error, the syntax of the invoking method is wrong

b)

The program runs fine but nothing is printed

c)

1 0

d)

1 2

22.
a)

Old

b)

New

c)

error

d)

Nothing is printed

23.
a)

Error as age isn’t defined

b)

True

c)

False

d)

7

24.
What characters are printed by the following statements?
s = "APCSP2018" 
idx = 1 
     while idx < len(s):     
          print(s[idx])      
          idx = idx + 2
a)
ACP08
b)
PS21
c)
APCSP2018
d)
Error
25.
Which line will give a type error (assuming the user gives a positive integer input) ?
a)
First
b)
Second
c)
Third
d)
Fourth
26.
What will print to the screen?
a)
0
b)
2
c)
3
d)
1
27.
Which of the following can complete the code so that 6.0 prints to the screen?
a)
* 3 / 2
b)
+ 1
c)
/ 0.5
d)
+ 3 * (1/ 2)
28.

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

a)

While loop

b)

Conditional Statement

c)

For loop

29.

What is the purpose of if statements in Python?

a)

To repeat a block of code a certain number of times.

b)

To define a function in Python.

c)

To perform different actions based on different conditions.

d)

To sort a list of elements in ascending order.

30.

Describe the process taking place in lines 10-13.

a)

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.

b)

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.

c)

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.

d)

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.

31.

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'?

a)

Within the try block

b)

Within the print("Correct!") line

c)

Within the except block

d)

No error

32.

What is the output of the program

a)

4

b)

2

c)

5

d)

0

33.

REST API services use for communication only HTTP protocol

a)

True

b)

False

34.

Correct the error if any

mycursor = mydb.cursor()


mycursor.execute("CREATE TABLE customers (name VARCHAR(25), 'address' VARCHAR(55))")

a)

mycursor.execute('CREATE TABLE customers (name VARCHAR(25), 'address' VARCHAR(55))')

b)

mycursor.execute("CREATE TABLE customers (name VARCHAR(25), address VARCHAR(55))')

c)

mycursor.execute("CREATE TABLE customers (name VARCHAR(25), address VARCHAR(55));")

d)

mycursor.execute("CREATE TABLE customers (name VARCHAR(25), address VARCHAR55))")

35.

What does the function re.search do?

a)

matches a pattern at the start of the string

b)

matches a pattern at the end of the string

c)

matches a pattern at any position in the string

d)

None

36.
_______ is used to search through a string starting at its beginning. It returns None if no match is found.
a)
re.match()
b)
re.Search()
c)
re.Method()
d)
re.search()
37.

What will be the output of the following Python function, assuming that the random module has already been imported?


random.uniform(3,4)

a)

error

b)

either 3 or 4

c)

Any integer other than 3 and 4

d)

Any decimal value between 3 and 4

38.

What will be the output of the following Python function (random module has already been imported)?


random.choice('sun')

a)

sun

b)

u

c)

either s,u or n

d)

error

39.

Which format specifier used in datetime module to generate the weekday in short format?

a)

%w

b)

%d

c)

%a

d)

none

40.

What is the purpose of generating random test data in Python?

a)

To make the code more complicated

b)

To slow down the code execution

c)

To make the code easier to debug

d)

To test the functionality and performance of the code under various scenarios.

41.

Switch stores ___ address.

a)

MAC address

b)

IP address

c)

PORT address

d)

EMAIL address

42.

In which topology data packet must have to pass through each nodes in the path.

a)

Mesh Topology

b)

Bus Topology

c)

Ring Topology

d)

Star Topology

43.

Choose among the following which is a bit-oriented protocol.

a)

SSL

b)

HDLC

c)

HTTP

d)

All of the above

44.

Who keeps the private key in asymmetric key cryptography?

a)

Sender

b)

Receiver

c)

Both Sender and Receiver

d)

None

45.

Which Protocol Data Unit (PDU) is used at the network layer?

a)

Segment

b)

Packet

c)

Frame

d)

Bits

46.

Which protocol is used to send packets

a)

IP

b)

FTP

c)

SMTP

d)

TCP

47.

Which of these is NOT part of TCP's role?

a)

Sets the rules for how devices connect on a network

b)

Makes sure data is correctly send and delivered

c)

To direct packets between routers

d)

Splits data into packets

48.

Encryption and decryption does not occur at___

a)

Router

b)

Switches

c)

Source Host

d)

Destination Host

49.
What type of encryption keys are used in HTTPS?
a)
Asymmetrical
b)
Randomly generated
c)
Symmetrical
d)
AES
50.
Where is the optimal place to have a proxy server?
a)
In between two private networks
b)
In between a private network and a public network
c)
In between two public networks
d)
On all of the servers
51.
Which type of firewall blocks packets based on rules that are based on IP addresses or ports?
a)
packet filtering
b)
stateful packet inspection
c)
NAT filtering
d)
Application-level gateway
52.
An IPSec component that provides the same services as AH but also provides confidentiality when sending data.
a)
authentication header 
b)
encapsulating security payload 
c)
security association
d)
Internet Protocol Security
53.

What are two reasons you should use IPsec between two computers

a)

data integrity and redundancy

b)

data redundancy and confidentiality

c)

data integrity and confidentiality

d)

data redundancy and compression

54.

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?

a)

SSL Proxy LB

b)

TCP Proxy LB

c)

Network Load Balancer

d)

Internal Load Balancer

55.

What is the main purpose of an Identity Aware Proxy (IAP)?

a)

To encrypt network traffic.

b)

To distribute incoming traffic.

c)

To manage user access to web applications.

d)

To route traffic based on IP addresses.

56.

What is a network load balancer?

a)

A network load balancer is a type of load balancer that is designed to route network traffic.

b)

A network load balancer is a type of load balancer that is designed to route HTTP and HTTPS traffic.

c)

A network load balancer is a type of load balancer that is designed to terminate SSL connections.

d)

A network load balancer is a type of load balancer that is designed to provide better security for traffic.

57.

Looks for specific network patterns generate by known malware.

a)

Signature based

b)

Host intrusion detection system (HIDS)

c)

Anomaly based

d)

Security functionality

58.

Proactive monitoring of unwanted intruders e.g. firewall.

a)

Intrusion prevention system

b)

Fuzzing

c)

Signature based

d)

Network intrusion detection system (NIDS)

59.

Firewalls, antivirus and anti spyware installed on every machine that monitors all incoming and outgoing traffic for suspicious activities

a)

Host intrusion detection system (HIDS)

b)

Distributed intrusion detection system (DIDS)

c)

Intrusion detection system (IDS)

d)

Network intrusion detection system (NIDS)

60.

Which of the following is NOT an IDS (Intrusion Detection System) characteristics?

a)

IDS can overlook system errors

b)

Survives with system crash and must be fault tolerant

c)

Runs constantly without human supervision

d)

Adaptability of system with technologies