NEW
Font size
WorksheetsPython Basics MCQs: Part 1
Total questions: 46
Worksheet time: 23mins
What is the correct file extension for Python files?
.py
.pt
.python
.pyt
Which data type is immutable?
Set
Tuple
Dictionary
List
What is the output of len('Python')?
5
6
7
Error
Which function is used to get input from the user?
get()
input()
read()
scan()
Which data type stores key-value pairs?
List
Tuple
Dictionary
Set
What does '==' operator do?
Comparison
Assignment
Increment
Decrement
What is the output of 10 // 3?
3.33
Error
3
4
Which function converts a string to integer?
int()
float()
str()
char()
What does break statement do?
Ends program
Stops loop
Pauses loop
Skips iteration
Which keyword is used to create a loop?
for
iterate
repeat
loop
What is the output of bool(0)?
False
Error
0
True
Which data type is ordered?
None
List
Dictionary
Set
Which function returns the length of a list?
count()
size()
length()
len()
Which operator is used for floor division?
/
//
**
%
Which statement is used to exit a function?
stop
exit
return
break
Which of the following is mutable?
Integer
List
String
Tuple
What does the 'is' operator check?
Size
Identity
Type
Value
What is the output of len([1,2,3])?
3
Error
4
2
What is the default value returned by a function?
/
0
None
False
Which loop executes at least once?
do-while
None
while
for
What is the output of 5 > 3?
True
False
5
3
Which statement is used to stop infinite loop?
exit
pass
break
continue
What is the primary purpose of a VLAN in a switched network?
Segment broadcast domains logically
Increase physical cable bandwidth
Encrypt traffic end-to-end by default
Replace routing protocols entirely
In IPv4, what does CIDR notation /24 indicate about the subnet mask?
Mask has 24 leading ones
Mask equals 24 decimal value
Mask replaces default gateway
Mask uses only 24 hosts
Which DNS record type maps a hostname to an IPv4 address?
A record mapping IPv4 address
AAAA record mapping IPv6
MX record specifying mail
CNAME record aliasing name
What command tests reachability by sending ICMP Echo Requests and measuring replies?
nslookup querying DNS
ping using ICMP echo
tracert showing hops
netstat listing sockets
In virtualization, what does a Type 1 hypervisor do?
Runs directly on hardware
Runs atop a host OS
Replaces guest kernels
Emulates only user apps
Which cloud model offers complete applications managed by the provider and accessed by users over the internet?
PaaS for developers
SaaS hosted applications
Private cloud on‑prem
IaaS virtual servers
What is the main benefit of infrastructure as code (IaC) in DevOps pipelines?
Less need for version control
Greater reliance on tickets
Manual configuration flexibility
Consistent repeatable provisioning
Which version control operation integrates changes from a feature branch into the main branch with a merge commit?
Forking creates remote copy
Rebasing rewrites history
Merging creates new commit
Cloning copies repository
What SQL clause filters rows returned by a SELECT query before grouping?
FROM listing tables
ORDER BY sorting rows
HAVING filtering groups
WHERE filtering rows
Which data structure uses FIFO ordering for element processing?
Graph with adjacency
Tree with root nodes
Stack with LIFO order
Queue with FIFO order
What is the Big-O time complexity of binary search on a sorted array?
O(log n) logarithmic time
O(n) linear per scan
O(n log n) hybrid time
O(1) constant always
What best describes a RESTful API characteristic for resource manipulation?
Stateless operations using HTTP verbs
Stateful sessions maintaining server memory
Binary RPC using persistent sockets
Tightly coupled endpoints per client
Which HTTP status code indicates that a resource was not found on the server?
301 moved permanently
500 internal error
404 not found response
200 successful request
What is the main security purpose of a DMZ in network architecture?
Provide wireless guest access
Isolate public-facing services
Encrypt internal database traffic
Replace internal VLAN segmentation
In public key infrastructure, what does a certificate authority primarily do?
Issues and signs certificates
Blocks revoked domains
Encrypts all email contents
Stores private keys centrally
Which malware type holds data hostage by encrypting files until payment is made?
Ransomware encrypting files
Worm self-replicating
Spyware monitoring users
Adware injecting popups
Which scheduling algorithm always picks the next job with the shortest expected processing time?
First come first served
Priority preemptive aging
Round robin time slices
Shortest job first selection
Which SDLC phase focuses on collecting stakeholder requirements and documenting system needs?
Design architecture phase
Requirements analysis phase
Implementation coding phase
Testing and QA phase
What does the principle of least privilege require when assigning user permissions?
Grant admin by default
Grant temporary guest access
Grant broad read rights
Grant only necessary access
Which command on Windows displays active network connections and listening ports?
netstat shows sockets
ipconfig shows addresses
route print shows table
tracert shows hop path
Which storage protocol commonly provides block-level access over Ethernet with targets and initiators?
Fibre Channel fabric
SMB file sharing protocol
NFS file level sharing
iSCSI block over Ethernet
What is the best reason to implement multifactor authentication on remote access VPNs?
Avoid VPN client updates
Eliminate password resets
Increase user login speed
Reduce account takeover risk
Which scripting language is most often used for automating tasks in Unix-like systems due to shell integration?
Ruby scripting tools
Perl scripting language
PowerShell scripting
Bash shell scripting
What is the function of ARP in IPv4 networks?
Assign IPs via dynamic leases
Resolve hostnames to IP addresses
Exchange routes between routers
Map IP addresses to MAC addresses
