Computer Science
Give two examples of each of the following:
- Arithmetic operators
- Relational operators
Related Questions
Assertion (A): A SELECT command in SQL can have both WHERE and HAVING clauses.
Reasoning (R): WHERE and HAVING clauses are used to check conditions, therefore, these can be used interchangeably.
- Both A and R are true, and R is the correct explanation of A.
- Both A and R are true, and R is not the correct explanation of A.
- A is true but R is false.
- A is false but R is true.
How is a mutable object different from an immutable object in Python ?
Identify one mutable object and one immutable object from the following:
(1, 2), [1, 2], {1:1, 2:2}, '123'
If L1 = [1, 2, 3, 2, 1, 2, 4, 2, …], and L2 = [10, 20, 30, …], then
(Answer using builtin functions only)
(a) Write a statement to count the occurrences of 4 in L1.
OR
(b) Write a statement to sort the elements of list L1 in ascending order.(a) Write a statement to insert all the elements of L2 at the end of L1.
OR
(b) Write a statement to reverse the elements of list L2.
Identify the correct output(s) of the following code. Also write the minimum and the maximum possible values of the variable b.
import random a = "Wisdom" b = random.randint(1, 6) for i in range(0, b, 2): print(a[i], end = '#')
- W#
- W#i#
- W#s#
- W#i#s#