Ques 1.
Rectify the given errors given in the screenshot.
Ques 2.
Write a python program to print the table of a number in reverse order using for loop.
Please help me with this question.
I will definitely mark brainliest for the correct and complete answer.
Attachments:
Answers
Answered by
110
Answer:
Explanation:
I couldn't send typed answer because it was showing improper so plz adjust with screenshot mark me best
Attachments:
Answered by
140
1. Error rectification
Code 1:
Given snippet:
Corrected snippet:
Explanation:
- Correction 1: To assign a value to a variable, a single '=' (equal to) operator is used. '==' is used to test for equality and not assigning.
- Correction 2: The symbol for lesser than or equal to is '<='.
- Correction 3: The closing bracket was missing.
- Correction 4: Since Python is a case-sensitive program, x and X are both different variables. The variable we need for this program is the one that was given as the first command, i.e., x = 10.
- Correction 5: Same as correction 4, x and X are both different.
- Correction 6: The use of colon was not needed.
Code 2:
Given snippet:
Corrected snippet:
Explanation:
- Correction 1: The symbol to use for assigning values into variables is '='.
- Correction 2: The colon must appear at the end of the statement.
- Correction 3: The symbol for multiplication is an asterisk (*).
Code 3:
Given snippet:
Corrected snippet:
Explanation:
- Correction 1: The data type must be called out first before the function.
- Correction 2: The same as correction 1.
- Correction 3: Since Python is a case-sensitive language, 'for' and 'For' will be considered different.
- Correction 4: The syntax of the range function is .
Code 4:
Given snippet:
Corrected snippet:
Explanation:
- Correction 1: The appropriate syntax to call out the integer data type is .
- Correction 2: The syntax of the range function is .
- Correction 3: Since Python is a case-sensitive language, 'PRINT' and 'print' will be considered different.
- Correction 4: The use of 'then' is not needed in an if conditional statement.
- Correction 5: The same reasoning as correction 3.
2. Python program
Similar questions
Math,
15 days ago
Chemistry,
15 days ago
Math,
1 month ago
English,
1 month ago
Social Sciences,
9 months ago