Miscellaneous
12 previous year questions.
High-Yield Trend
Chapter Questions 12 MCQs
print(16 * 5 / 4 * 2 / 5 - 8) -3.33
0.0
Consider a binary file, items.dat, containing records stored in the given format:
Write a function, Copy\_new(), that copies all records whose amount is greater than 1000 from items.dat to new\_items.dat.
Sangeeta is a Python programmer working in a computer hardware company. She has to maintain the records of the peripheral devices. She created a csv file named Peripheral.csv to store the details. Structure of Peripheral.csv:
\begin{tabular}{|c|c|c|} \hline \textbf{P\_id} & \textbf{P\_name} & \textbf{Price} \\ \hline \end{tabular}
P\_idis the Peripheral device ID (integer).P\_nameis the Peripheral device name (string).Priceis the Peripheral device price (integer).
Sangeeta wants to write the following user-defined functions:
Add\_Device(): To accept a record from the user and add it to the CSV file,Peripheral.csv.Count\_Device(): To count and display the number of peripheral devices whose price is less than 1000.
- Add the constraint, primary key to column P_id in the existing table Projects:
- Change the language to Python of the project whose ID is P002:
- Delete the table Projects from the MySQL database along with its data:
Write the SQL commands to perform the following tasks:
(i) View the list of tables in the database Exam
(ii) View the structure of the table Term1
LS = ["HIMALAYA", "NILGIRI", "ALASKA", "ALPS"]
D = {}
for S in LS: if len(S) % 4 == 0: D[S] = len(S)
for K in D: print(K, D[K], sep = "#") The code given below accepts five numbers and displays whether they are even or odd:
Observe the following code carefully and rewrite it after removing all syntax and logical errors.
Underline all the corrections made.
Assertion (A): The expression "HELLO".sort() in Python will give an error.
Reason (R): sort() does not exist as a method/function for strings in Python.
Mark the correct choice:
Fill in the blank:
is a set of rules that needs to be followed by the communicating parties in order to have a successful and reliable data communication over a network.
a = 20 def convert(a): b = 20 a = a + b convert(10) print(a)Select the correct output from the given options:
10
20
30
Error
print("A"*3)
print(5*3)
print("15" + 3)
print("15" + "13")
PPP
HTTP
FTP
SMTP