13. what will be displayed by the following code?\nmatrix = 1, 2, 3, 4,\n 4, 5, 6, 7,\n 8, 9, 10, 11,\n 12…

13. what will be displayed by the following code?\nmatrix = 1, 2, 3, 4,\n 4, 5, 6, 7,\n 8, 9, 10, 11,\n 12, 13, 14, 15\n\nfor i in range(0, 4):\n print(matrixi2, end = \ \)\n\no 3 6 10 14\no 8 9 10 11\no 2 5 9 13\no 4 5 6 7\n\n14. what method is used to capture string data from the keyboard?\no input()\no print()\no str()\no upper()\no lower()

13. what will be displayed by the following code?\nmatrix = 1, 2, 3, 4,\n 4, 5, 6, 7,\n 8, 9, 10, 11,\n 12, 13, 14, 15\n\nfor i in range(0, 4):\n print(matrixi2, end = \ \)\n\no 3 6 10 14\no 8 9 10 11\no 2 5 9 13\no 4 5 6 7\n\n14. what method is used to capture string data from the keyboard?\no input()\no print()\no str()\no upper()\no lower()

Answer

Question 13

Explanation:

Step1: Understand the matrix

The given matrix is a 4 - by - 4 list of lists in Python.

Step2: Analyze the loop

The for loop iterates from i = 0 to i=3. For each i, it prints the element at index 2 (third element as indexing starts from 0) of the i - th sub - list of the matrix. When i = 0, matrix[0][2]=3; when i = 1, matrix[1][2]=6; when i = 2, matrix[2][2]=10; when i = 3, matrix[3][2]=14.

Answer:

3 6 10 14

Question 14

Brief Explanations:

In Python, the input() function is used to capture string data entered from the keyboard. The print() function is for outputting data, str() is for converting other data types to strings, and upper() and lower() are for converting strings to uppercase and lowercase respectively.

Answer:

input()