ANSWER KEY: PYTHON- REVISION WORKSHEET 7TH
7TH COMPUTER REVISION- ANSWER KEY: 1. Name the different types of conditional statements in Python. ans) If, elif, else 2. Define looping statements in Python. Give any two types of looping statements. ans) This statement is used to execute a set of instructions multiple times. Eg: while loop, for loop. 3. List the different types of arithmetic operators in Python. ans)Addition(+) , Subtraction(-) , Multiplication(*) , Division(/). 4. Write a program in Python to print the first 5 multiples of 3 using range function. ans) 5. Write a program in Python to display whether the number is positive or negative. ans) 6. Analyse the given code and write the output: n=1 while n<=10: print(n) n=n+1 ans) 7. Differentiate between runtime error and syntax error in Python. ans) SYNTAX ERROR RUNTIME ERROR Syntax error occurs when certain rules are not followed. Eg: i)Missing parentheses , colon ,comma. ...