Computer Science
Write the Python statement for each of the following tasks using BUILT-IN functions/methods only:
(i) To insert an element 200 at the third position, in the list L1.
(ii) To check whether a string named, message ends with a full stop / period or not.
Related Questions
Write a function, lenWords(STRING), that takes a string as an argument and returns a tuple containing length of each word of a string. For example, if the string is "Come let us have some fun", the tuple will have (4, 3, 2, 4, 4, 3).
Predict the output of the following code:
S = "LOST" L = [10, 21, 33, 4] D = {} for I in range(len(S)): if I % 2 == 0: D[L.pop()] = S[I] else: D[L.pop()] = I + 3 for K, V in D.items(): print(K, V, sep = "*")
A list named studentAge stores age of students of a class. Write the Python command to import the required module and (using built-in function) to display the most common age value from the given list.
Ms. Shalini has just created a table named “Employee” containing columns Ename, Department and Salary. After creating the table, she realized that she has forgotten to add a primary key column in the table. Help her in writing an SQL command to add a primary key column EmpId of integer type to the table Employee. Thereafter, write the command to insert the following record in the table:
EmpId - 999
Ename - Shweta
Department: Production
Salary: 26900