Page 335 - Artificial Intellegence_v2.0_Class_9
P. 335
12. While loop is also called ………………………. loop.
13. List is a collection of ………………………. data arranged in a sequence.
14. List is a ………………………. data type in python.
15. The index number begins with 0 till length-1 in ………………………. .
C. State whether these statements are true or false.
1. Understanding the problem is the last step in computer problem solving. ……….……
2. Algorithm follows strict rules of writing the instructions. ……….……
3. Flow-charts are difficult to maintain for complex programs. ……….……
4. There are no specific tools for branching and looping in algorithms. ……….……
5. Algorithms are just a waste of time before writing a code. ……….……
6. Step value is compulsory in while loop. ……….……
7. Indentation is not important in conditional programming. ……….……
8. While loop repeats a set of instructions indefinite number of times. ……….……
9. For loop is used to give conditions and executes only once. ……….……
10. If condition is True then the block of statement written for True will be executed. ……….……
11. The count( ) returns the index number of the value given in the function. ……….……
12. Slicing a list means accessing a specific portion of a list. ……….……
13. Operands on either side of the + operator have to be a list. ……….……
14. We cannot create an empty list. ……….……
15. A list can be created within another list. ……….……
D. Find the errors in the given code and write the correct code:
1. a = input("enter a number)
Ans. a = input("enter a number")
2. b + c = a
Ans. a = b + c
3. print("hello + Friends")
Ans. print("hello" + "Friends")
4. marks==total/2
Ans. marks=total/2
5. a=input(int("enter marks"))
Ans. a=int(input("enter marks"))
6. num#1 = 100
if (num == 100)
print (Number is: num
print ("Thanks!")
Ans. Correct code is:
num = 100
if (num = 100)
Introduction to Python 333

