Computer Science - Informatics Practices Class XI/XII Python List Solved Test Part 3

 

Computer Science - Informatics Practices Class XI/XII Python List Solved Test  Part 3

 Q1. Write the output of the following

      

Q2. Fill the index value in place of ‘?’ as output should come as below:

             

                 

                                

Q3. Write the output of the following three parts:

           

     

                

               

    

SOLUTIONS

Ans1.

1

2

3

4

5

Ans 2

0

1

6

2

1

Ans 3 a)

p

r

a

c

t

i

c

e

Ans 3 b)

practice

Ans 3 c)

p?r?a?c?t?i?c?e?

 

Computer Science - Informatics Practices Class XI/XII Python List Solved Test Part 2

 

Computer Science - Informatics Practices Class XI/XII Python List Solved Test  Part 2

Q1. Write the code to create the list of::

  1. Five vegetables
  2. Vowels
  3. First 10 natural numbers
  4. Square of first 5 natural numbers.
  5. Any five names of your friends
  6. All the alphabets of word “Taj Mahal”
  7. First five multiples of 6.

Q2. Write a code to convert the string “Practice” into list.

Q3. Write the output of the following:

>>> d = “a*hj?”

>>> list(d)

Q4. Write the output of the following:

>>>a = “String”

>>>list (a)

Q5. Write the output of the following:

>>> a = list ()

>>> a

Q6. What is list() function?

Q7. Write the output of the following:

     

SOLUTIONS

Ans 1:

 b = ['a','e','o','i',u']

 c = [1,2,3,4,5,6,7,8,9,10]

 d = [1,4,9,16,25]

 e = ['amit','anuj','ashu','suman','mridul']

 f = ['T','a','j','M','a','h','a','l']

 g = [6,12,18,24,30,36]


Ans 2: a = list("Practice")

Ans 3: ['a','*','h','j','?']

Ans 4: ['S','t','r','i','n',g']

Ans 5: []

Ans 6: list() function is used to create empty list and it can also convert certain type of object into list.

Ans 7: 

Computer Science - Informatics Practices Class XI/XII Python List Solved Test Part 1

 

Computer Science - Informatics Practices Class XI/XII Python List Solved Test  Part 1

Q1. What do you mean by List in Python?

Q2. The elements in the list can be of ______ type

   (any/fixed)

Q3. Elements in the list are enclosed in _____ brackets

Q4. Values in the list are called _______.

Q5. Lists are ________ in nature (heterogeneous/homogeneous)

Q6. List is a _________ data type. (Linear/non-linear)

Q7. Elements in the list are separated by ______.

Q8. Write the code to create an empty list named ‘L’.

Q9. Write a code to create list of any three colors named

   ‘color’.

Q10. What do you mean by nested list


 

 

SOLUTIONS

Q1. What do you mean by List in Python?

Ans. A list is a data structure which is mutable and 

    ordered sequence of elements.

Q2. The elements in the list can be of ______ type

   (any/fixed)

Ans. any

Q3. Elements in the list are enclosed in _____ brackets

Ans. Square([])

Q4. Values in the list are called _______.

Ans. Item

Q5. Lists are ________ in nature (heterogeneous/homogeneous)

Ans. Heterogeneous

Q6. List is a _________ data type. (Linear/non-linear)

Ans. Linear

Q7. Elements in the list are separated by ______.

Ans. Comma (,)

Q8. Write the code to create an empty list named ‘L’.

Ans. L = []

Q9. Write a code to create list of any three colors named 

   ‘color’.

Ans. color = ["blue", "black", "red"]

Note : You can write any other color of your choice

Q10. What do you mean by nested list

Ans. A list inside another list is called nested list.

 

Class XII : Data Structure Test 1

 

Data Structure Test 1

Q1. What do you mean by data structure?

Q2. Name any one linear data structure in python.

Q3. Python list are ______________ in Nature (static/dynamic)

Q4. “Lists are dynamic in nature” What do you mean by this statement?

Q5. What do you mean by Stack?

Q6. Name the end where we add or remove element in stack.

Q7. What is the full form of LIFO?

Q8. Give two example of stack from daily life.

Q9. Name two operations performed in stack.

Q10. What is the order of inserting elements in the following stack?

 

 

 

Ans 1. A data structure is a way of storing, organizing and retrieving data in a computer.

Ans 2. List

Ans 3. Dynamic

Ans 4. This means that list can be grown or shrink in size means elements can be deleted or added in list.

Ans 5. A stack is a linear data structure where elements can be inserted or deleted at one end.

Ans 6. Top

Ans 7. Last in First Out

Ans 8. A pile of book, a stack of carom coins etc.

Ans 9. Push and Pop

Ans 10. Order is: A, B, C, D

 

Most Recently Published

File Handling Test 6

 File Handling Test 6 Q1 . Do we need to use the close() function when we use 'with' statement to open a file? Q2. Which mode you wi...

CS - IP Assignment/Worksheet