Posts

Showing posts with the label CBSE class 8 Python list loop functions solved exercise question answer worksheet

CBSE class 8 Python list loop functions solved exercise question answer worksheetClass:8 , Sub : Computer , Ch.8 Python–Lists, Loops and Functions [N.B]

Image
CBSE class 8 Python list loop functions solved exercise question answer worksheet Class:8 , Sub : Computer , Ch.8 Python–Lists, Loops and Functions [N.B]   1.  Select the correct option . a.                   Items in a list with five elements will have index from               . i.   1to4            ii.1 to 5             iii.0to5              iv.0to4   Ans:       0to4 b.                   The method used to remove an item from a list is                  . i.  pop()           ii. remove()         iii. both (i)and(ii)        iv.none of the above Ans:     remove() c.                    Each execution of a loop is called                    . i.  cycle          ii. iteration         iii. phase              iv.none of the above Ans:      iteration d.                   The                  statement is used to go ahead to the next iteration without executing the remaining statements in the loop i.  continue      ii. break                iii.Else                iv.stop Ans:     continue

CBSE class 8 Python list loop functions solved exercise question answer worksheet

CBSE class 8 Python list loop functions solved exercise question answer worksheet Select the correct option. a. Which of the following is used to refer to each item in a list? [R] base index integer strings b. Which error will be shown if you try to access the element that is not defined in the code? [U] IndexError TypeError FileError TextError c. Which operator can be used to access the range of items from a list. [R] : - + * d. Which of the following methods is used to delete a particular element from the list? [R] delete() remove() cut() set() e. Which of the following can be used to add an item at the end of the list? [R] add() append() plus() pop() Answer in one word. [U] a. A program structure containing one or more instructions that are excecuted repeatedly.  Ans: Loops b. The type of loop that is used to iterate over a sequence, such as a list or a string. Ans: Counter-controlled Loop/For loop c. The function that is used to generate a sequence of numbers. Ans: range () functio

CBSE class 8 Python list loop functions solved exercise question answer worksheet

Image
1 CBSE class 8 Python list loop functions solved exercise question answer worksheet Select the correct option.  Items in a list with five elements will have index from _______.  i. 1 to 4         ii. 1 to 5           iii. 0 to 5          iv. 0 to 4 Ans: 0 to 4 The method used to remove an item from a list is _________.  i. pop()          ii. remove()   iii. both i) and ii)     iv. none of the above Ans: remove()    Each execution of a loop is called _________.  i. cycle         ii. iteration        iii. phase             iv. none of the above Ans: iteration The _________ statement is used to go ahead to the next iteration without executing the remaining statements in the loop  i. continue     ii. break              iii. Else              iv. stop Ans: continue 2. What will be the output of the following code?  Ans: 96 Ans: 1 4 9 Ans: > 3. Answer the following a. What is the difference between a ‘while’ and a ‘for’ loop?  Ans: The ‘for’ loop in Python is used to iterate over a sequen