Professional Documents
Culture Documents
Plus Two Computer Science Short Answers
Plus Two Computer Science Short Answers
Plus Two Computer Science Short Answers
4. How can you assign multiple values to multiple variables in one line?
By separating the values with commas and assigning them to respective variables.
17. Can you change a string after it's been created in Python?
No, strings are immutable in Python.
21. What method in Python is used to add an element to the end of a list?
The 'append()' method.
33. What happens if you try to access a key in a dictionary that doesn't exist?
It raises a 'KeyError' exception.
51. How do you insert specific values into a table using SQL?
- By specifying the column names and their respective values in the INSERT
statement: `INSERT INTO table_name (column1, column2) VALUES (value1, value2);`
55. How do you delete specific records from a table using SQL?
By using the DELETE statement with the WHERE clause to specify the conditions for
deleting records: `DELETE FROM table_name WHERE condition;`
59. How do you use the GROUP BY clause with aggregate functions?
By combining the GROUP BY clause with functions like COUNT(), SUM(), AVG(), etc.,
to perform calculations on grouped data.
64. Explain the purpose of the `plt.xlabel()` and `plt.ylabel()` functions in Pyplot.
plt.xlabel()` and `plt.ylabel()` are used to label the x-axis and y-axis of the plot,
respectively.