
Q61
Q61 What will the following Python code return?
re.search(r"\d{3}", "The code 123 is valid")
Q62
Q62 Identify the issue in this regex:
re.findall(r"[A-Z+]", "Python+C+Java")
Incorrect use of escape character
Wrong pattern for matching uppercase letters
'+' should not be escaped
No issue
Q63
Q63 In Python, which module is used to work with CSV files?
csv
json
excel
fileio
Q64
Q64 What does the following code do?
import json; json.loads('{"name": "John", "age": 30}')
Creates a JSON file
Parses a JSON string into a Python dictionary
Serializes a Python dictionary to JSON
Throws an error
Q65
Q65 What is the purpose of a virtual environment in Python programming?
Version control
To isolate project-specific dependencies
Web development
Data analysis
Q66
Q66 Which tool is used to install Python packages?
git
virtualenv
pip
setuptools
Q67
Q67 What is the key benefit of using requirements.txt in a Python project?
For documenting the code
To list all the packages and their versions used in the project
To improve the performance of the project
For version control
Q68
Q68 What is the primary use of the OS module in Python?
Networking
Web development
Interacting with the operating system
Data analysis
Q69
Q69 Which function in the OS module is commonly used to change the current working directory?
os.change_directory()
os.chdir()
os.setcwd()
os.update_directory()
Q70
Q70 What does os.listdir('.') do?
Lists all Python files in the current directory
Creates a new directory
Lists all files and directories in the current directory
Deletes the current directory
Q71
Q71 What is PEP in the context of Python?
A Python enhancement proposal
A Python error protocol
A Python environment path
A Python executable program
Q72
Q72 Python is known as:
A compiled language
An interpreted language
A machine language
An assembly language
Q73
Q73 Which version of Python removed the print statement?
Python 1.x
Python 2.x
Python 3.x
Python 4.x
Q74
Q74 Which of the following is a valid Python comment?
Q75
Q75 Python is a:
Low-level language
High-level language
Middle-level language
Machine-level language
Q76
Q76 Which of these data types does Python not natively support?
Lists
Tuples
Arrays
Dictionaries
Q77
Q77 Which of the following is a mutable data type in Python?
String
Tuple
List
Integer
Q78
Q78 What will be the data type of the variable x after this assignment:
x = 3.5?
int
float
str
complex
Q79
Q79 What is the output of the following code snippet:
print(type("Hello, World!"))
Q80
Q80 What does the following code output:
x = [1, 2, 3];
print(type(x) == list)
TRUE
FALSE
Error
None
Q81
Q81 What will be the output of the following pseudocode?
Initialize x as 10;
If x is of type int,
print "Integer"
else
print "Not Integer"
Integer
Not Integer
Error
None
Q82
Q82 Pseudocode:
Variable
x = "Python";
Check if x is a string,
if yes
print "String",
otherwise
"Not a String"
String
Not a String
Error
None
Q83
Q83 Identify the error in this code:
x = [1, 2, 3];
print(x)
Syntax error in variable x
Missing parenthesis in print
Missing bracket in x
No error
Q84
Q84 Find the mistake:
x = (1, 2, 3);
x[1] = 4;
print(x)
Tuples are immutable
x[1] should be x[2]
Syntax error
No error
Q85
Q85 Which function is used to read input from the console in Python?
input()
read()
scan()
getInput()
Q86
Q86 What is the default type of data returned by the input() function in Python 3.x?
int
string
boolean
list
Q87
Q87 Which function in Python is used to display data as output?
display()
print()
show()
output()
Q88
Q88 What is the purpose of the end parameter in the print() function?
To add a space at the end
To end the script
To specify the string appended after the last value
To break the line
Q89
Q89 What does the sep parameter do in the print() function?
Separates lines
Specifies separator between values
Separates syntax errors
None of these
Q90
Q90 Pseudocode:
Ask user for number, multiply by 2, print result
Reads number, prints double
Reads string, prints same
Error in input
No output

