File Handling Quiz-17

Share with others

Welcome to your File Handling Quiz-17

Name
Email
Email
Q161. Which of the following statement return the data in the form of mutable data type?

Q162. Which of the following statement is not correct in context of CSV files?

Q163. Rani is a class XII Computer Science student. She is writing few functions of csv module. As a friend of Rani, help her to identify the function which is not in csv module.

Q164. Write the output of the following code:

Suppose the content of “weight.txt” is:

When you feel like quitting, think about why you started

Every step is progress, no matter how small

What will be the output of the following code?

fn= open (“weight.txt”)
data = fn.read( ). split( )
print (len (data))
fn.close ( )

 

Q165. What will be the output of the following code?

Suppose the content of “weight.txt” is:

Success is no accident: it is hard work and perseverance

fn = open ("story.txt")
l = "aeiouAEIOU"
v = 0
d = fn.read ( )
for i in d:
    if (i in l):
        v+=1
print (v)
fn.close ( )

Q166. In _________ file, no delimiters are used for line.

Q167. _______________ file mode used to write data into binary file.

Q168. What will be the output of the following code?

Suppose content of 'weight.txt' is:

Success is no accident.
it is hard work and perseverance


fn = open ("weight.txt")
d = fn.readline( )
print (len(d))
fn.close ( )

Q169. What will be the output of the following code?

Suppose content of 'weight.txt' is:

Success is no accident.
it is hard work and perseverance


fn = open("story.txt",'r')
data = fn.read()
d = data.split()
w=0
for i in d:
    if (len(i)<3):
        w += 1
print(w)
fn.close()

Q170. What will be the output of the following code?

Suppose content of 'weight.txt' is:

Success is no accident.
it is hard work and perseverance


fn = open("story.txt",'r')
data = fn.read()
print(data.count("an"))
fn.close()


Share with others

Leave a Reply

error: Content is protected !!